Game Development Community

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.

About the author

Recent Threads


#1
07/02/2008 (2:22 am)
This is for TGE but looking at it may give you an idea. Implementation should be similar but I've never even looked at TGB, so I don't know. Charge Jump
#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.