Character jump in platform game

Hi. Im trying to make my character jump, but i dont know how to start…

I want something like this:
If i hold jump button, then my character must go up to a certain height, then comes a gravity effect, an then he goes down.
But if i release jump button before he reach max height, then in that same moment comes gravity effect, and he goes down.

How can i implement jump? how many variables i must control for generate a good gravity effect? speed?time?

And how to link that with the floor?(If i reach floor, then stop jump)


I didn’t read the whole article but I read most of it. This helps you add gravity and jump thats all based on game time.

let me know if it help you out and good luck with your game!

Great! that’s what i was searching for :smiley: Thank you!