If you need gravity, you can program it yourself after 5 minutes. Freely falling objects are accelerated at a speed of 9.8 meters per second per second, that is, an object downward speed increases by 9.8 meters per second of free fall. For the game you will want to divide this 9.8 into any frame rate you have. For jumping, simply select a significant negative vertical speed, apply this to the character the moment they jump, and reduce it by incrementing the gravity in each frame. This is really all you need for something like Mario, unless you are looking for a three-dimensional background for your 2d scroller.
If you want to become more attractive, you can try to take into account the force of the object, making the falling objects harmful people or cracks or something else. To do this, we use the formula for kinetic energy: KE = 1/2 * M * V ^ 2, where M is mass and V is velocity.
The Digital Gabeg Sep 19 '08 at 1:39 2008-09-19 01:39
source share