Mario style jumping code
Blitz3D Forums/Blitz3D Beginners Area/Mario style jumping code
| ||
Hello everyone, I'm working on my first 3rd person game and am trying to incorporate a nice smooth jump like the one seen in every Mario Bros game. I have found a lot of useful jumping code through the forums and have been trying to write my own code that lets you jump higher the longer you hold the jump button down. Any help or tips would be great :-) |
| ||
When jump is 'pressed' set an initial upwards force/acceleration on the character. For each 'n' milliseconds that the jump button is held down for, up until 'm' milliseconds since the jump started, add a small increase to the upwards force/acceleration - this incremental force which is added should be small relative to the initial upwards force. |
| ||
yeah, or make a variable that acts as the y axis of the character, and while you hold jump, the variable increments, then have a while not holding jump, the variable decrements untill it reaches the ground |