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
help with jumps
Moderator: Coders of Rage
-
- Chaos Rift Newbie
- Posts: 30
- Joined: Sat Apr 18, 2009 8:17 pm
Re: help with jumps
Thanks to gyro vorbis for inspiring me to learn how to make a 2d graphics engine
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: help with jumps
Oh, I misread. When you're checking for SDL events, add a case for SDL_KEYUP.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
-
- Chaos Rift Newbie
- Posts: 30
- Joined: Sat Apr 18, 2009 8:17 pm
Re: help with jumps
ok thanks
Thanks to gyro vorbis for inspiring me to learn how to make a 2d graphics engine
-
- Chaos Rift Newbie
- Posts: 16
- Joined: Mon Nov 17, 2008 9:56 am
Re: help with jumps
DId you forgot that SDL's coordinate system is awkard...?Spikey wrote: To jump, add a Y+ velocity, say +20.
Then every tick, apply gravity, say -9
- Spikey
- Chaos Rift Cool Newbie
- Posts: 98
- Joined: Sat Dec 13, 2008 6:39 am
- Programming Language of Choice: C++
- Location: Ottawa, Canada
- Contact:
Re: help with jumps
whoops... Thanks for pointing that out.aerosmithfan4ever wrote:DId you forgot that SDL's coordinate system is awkard...?Spikey wrote: To jump, add a Y+ velocity, say +20.
Then every tick, apply gravity, say -9
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: help with jumps
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.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.