Jump height based on button press?
by Ragnarrok · in Technical Issues · 07/02/2008 (1:06 am) · 2 replies
So I just got started around here and followed the demo for the platformer
http://tdn.garagegames.com/wiki/TGB/Tutorials/Platformer
And I am wondering if there is a way to jump higher the longer the button is pressed down?
I've noticed in the different demos and such around the site the jump height is always the same.
Thanks in advance.
http://tdn.garagegames.com/wiki/TGB/Tutorials/Platformer
And I am wondering if there is a way to jump higher the longer the button is pressed down?
I've noticed in the different demos and such around the site the jump height is always the same.
Thanks in advance.
#2
07/02/2008 (3:41 am)
You could simply let the character start jumping when receiving the keypress event and let him go upwards all the while until either receiving the key release event or having the character get to the max jumping height. Then reverse the whole thing and let the character land on the ground.
Associate Michael Hall
Distracted...