i need help in setting up gravity in my game,
i have jumping and moving perfect but what i want to do is be able to jump onto platforms
can someone tell me how to do this
i made it so my character could jump on a platform but now he cant get back down becouse theres no gravity pulling him down to ground level
please help somebody
Offline
<when green flag clicked>
<forever>
<if><< <not> <touching[ Ground ] >>
<change{ Y velocity }by( -1
<change y by( Y Velocity
<else>
<set{ Y velocity }to( 0
<end>
That makes your sprite accelerate to the ground at 1 pixel per frame squared. If you just need generic gravity that pulls them down without acceleration use this:
<when green flag clicked>
<forever if> <not> <touching[ Ground ] >>
<change y by( -1
<end>
You also don't have to use -1 for either of them, use a higher number and they'll fall faster.
Last edited by thecooltodd (2008-04-13 13:22:21)
Offline
cheers mate worked perfectly ur great
Offline