This site requires JavaScript, please enable it in your browser!
Greenfoot back
Mint_Green
Mint_Green wrote ...

2014/2/7

How would I make a character jump?

Mint_Green Mint_Green

2014/2/7

#
Hi, I'm making a clone of Super Mario Smash Bros. but the question I have is how would I make the player jump? Mint_Green says Thank You!
danpost danpost

2014/2/7

#
You would need an int field to track the vertical speed. Increase its value by one each act cycle to introduce gravity. If the actor is found to intersect any object while moving vertically, set the vertical speed to zero and move the actor back (opposite the direction it moved) off the object. The direction it moved can be determined by the sign of the field holding the vertical speed.
Mint_Green Mint_Green

2014/2/8

#
Thank you for your help danpost!
You need to login to post a reply.