Skip to main content

Jumping Characters

Submitted by Kane on
Forum

I'm not making a game involving this or anything, I was just curious because I have never tried to do it before...

How do you make a 2D character jump? Is it like moving the image up a certain number of pixels over time, then dropping them down again?

And how how would you tell when the character has jumped and landed on a higher platform?

Submitted by Daemin on Fri, 02/04/04 - 10:36 PM Permalink

You just move the character's y position up temporarily. Like you'd keep a flag or a variable that tells you how many more seconds the character will be jumping up for, and you keep moving them up for that period of time, then after that you just let gravity do the work to get down.

If they jumped up on a hihger platform that would just mean that they have landed on a higher platform, just by virtue of following the laws of gravity (albeit to some limited extent)

Submitted by Kane on Fri, 02/04/04 - 10:43 PM Permalink

cool...i thought that was how it would work...just wanted to be sure...thanks!

Posted by Kane on
Forum

I'm not making a game involving this or anything, I was just curious because I have never tried to do it before...

How do you make a 2D character jump? Is it like moving the image up a certain number of pixels over time, then dropping them down again?

And how how would you tell when the character has jumped and landed on a higher platform?


Submitted by Daemin on Fri, 02/04/04 - 10:36 PM Permalink

You just move the character's y position up temporarily. Like you'd keep a flag or a variable that tells you how many more seconds the character will be jumping up for, and you keep moving them up for that period of time, then after that you just let gravity do the work to get down.

If they jumped up on a hihger platform that would just mean that they have landed on a higher platform, just by virtue of following the laws of gravity (albeit to some limited extent)

Submitted by Kane on Fri, 02/04/04 - 10:43 PM Permalink

cool...i thought that was how it would work...just wanted to be sure...thanks!