Simple Jump
I am making a mario style sidescroller and I have made a button for the player to jump but he just keeps going up until let go of the button. I just want the player to have limited jump time so he goes up for a second and comes down ( smoothly if possible).
Comments
If you have more questions, ask. My templates below might be of help to you.
___________________________________________________________________________________
One Touch Ninja Platformer Template
Red Bouncing Ball Template
Basically, you need an attribute on your actor, let's call it "Grounded".
Whenever your actor collides with a ground object and his Self.Motion.Linear.Y = 0, he has landed so set Grounded to true.
Then when you press your jump key, if Grounded = true, and his Self.Motion.Linear.Y is still 0, you can jump - so set Self.Motion.Linear.Y to something like 200 to 400 and set Grounded to false.
Then either have a constant downward accelerate as jb15 suggests, or set the Gravity attribute of the Scene.