I am trying to create a Flash game using AS3. I am a newb in programming. The problem that I am having has to do with the game's jumping a gravity mechanics.
Currently, the Up Key makes the character move upwards (speed of 20 pixels/frame) if it's down. If the Up Key isn't down, the character stops moving upwards. If the character is off of the ground, then the force of gravity is in play as well. If the character is off of the ground, the gravity variable (originally 0) increases by (1.5) every frame. The gravity variable then counteracts the character until it's pulled to the ground. On the ground, the gravity variable is back at 0.
This works pretty well. However, the smooth and curve-like jump is only achievable if the Up Key is ALWAYS pressed down. Otherwise, you fall down really quickly if you release the Up Key. I know that I could fix this by changing the jump from a hold-down-key jump to a on-tap-key jump. However, I don't want to do that.
TL;DR I want a perfect parabolic jump!