Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: hellninjas on November 13, 2011, 05:20:18 pm
-
ok i need help with my collision... I want to make a normal field, with a line in the center of the screen, the ball can only land on top of the line...
It cannot jump through it... Or better yet, how would I do collision in general? Help!
-
Ask my brother TBO_Yeong :P
He's dont that a lot of time :D
-
Just so a ball doesn't fall through a line?
I have no idea of to what extent the advancedness of what you want is... But whatever.
If assuming that's what you want, but I might be wrong :P
Just do something like
If y-sprite height<25
Y++
End
If the line is at 25 y axis.
For collision in general to check if 2 things are touching I usually do
X is x of first object
Y is y of first object
A Is x of second
B is y of second
If abs(X-A)<6
If abs(Y-B)<6
Stuff
End
End
That'll check if if the 2 objects are less than six pixels apart.
-
Well, you'd have to do this instead:
Line(0,25,96,25)
If Y-(Sprite Height)<25
.Whatever
End
-
Oh yeah. But if you're holding the screen upside down... :P
-
then it would move down until its top was even with the line ;)
-
If you were Holding the screen upside down and the object was coming up from the bottom of the screen and the sprite was rotated 180°. Then it would work!
-
Well thanks for the help, I've been needing this for some of my games that had gravity in it...