So I am making a Top Down Zelda Clone (what's new??) using custom movement. I have my collisions working just fine, but now I wanted to add a jumping ability for the player. does anyone know of a method that would easily accomplish this. All the help will be greatly appreciated.
Hello guys! I'm New! -- I've been new for a year now...haha
If you're using a sensor to show his position on the ground, then you can make it so that the sprites always dispositioned from that sensor, and adding to a number that shows how high he's jumping.
So if you have:
Player Position = Sensor Position + Jump Height
And for the most part the jump height is always 0, then he'll always be walking on the ground.
Then when you jump, you can have it subtract from the Jump Height and then add back to it.
Bare minimum idea here, I'm sure once you get it working, you'll find that the basic idea is much more flexible. Using multiple values and such to get more fluid jumping or more control over your sprites.
PS: You can also just as easily add a shadow to always position itself to said sensor, so that when you jump, you go up but the shadow stays on the ground. You can even go as far as to make the sprite get bigger (or smaller based on your style) and less transparent as you jump. All of this adds small detail to the game that no one notices off hand, but once you add a bunch of these small details, you get a rather impressive presentation.