Page 2 of 2
Re: help with jumps
Posted: Sun Apr 26, 2009 10:35 pm
by deathsangel
No I want it so that cant jump is set to false either
1)when you get to the target height
2)when you let go of space.
Number 1 works, number 2 doesnt
Re: help with jumps
Posted: Mon Apr 27, 2009 3:08 pm
by MarauderIIC
Oh, I misread. When you're checking for SDL events, add a case for SDL_KEYUP.
Re: help with jumps
Posted: Mon Apr 27, 2009 7:52 pm
by deathsangel
ok thanks
Re: help with jumps
Posted: Thu Apr 30, 2009 5:35 am
by aerosmithfan4ever
Spikey wrote:
To jump, add a Y+ velocity, say +20.
Then every tick, apply gravity, say -9
DId you forgot that SDL's coordinate system is awkard...?
Re: help with jumps
Posted: Thu Apr 30, 2009 8:02 am
by Spikey
aerosmithfan4ever wrote:Spikey wrote:
To jump, add a Y+ velocity, say +20.
Then every tick, apply gravity, say -9
DId you forgot that SDL's coordinate system is awkard...?
whoops... Thanks for pointing that out.
Re: help with jumps
Posted: Thu Apr 30, 2009 8:35 am
by MarauderIIC
I think that's the generally accepted way to put coordinates together. Negative is "up." For instance, take a game of Quake 2 or 3. "set gravity 100" pushes you down. "set gravity -100" flings you into the ceiling.