Game Development Community

Time-based jumping & double-jumping

by Jason Fox · in Torque X Platformer Kit · 04/16/2010 (7:53 pm) · 3 replies

Hi everyone. I am working getting these two features working in our game and I started to use this method for time-based jump and this method for double jumping, but the two implementations interfere with each other.

What I mean is that the time-based jumping depends on the player holding down the jump button, resulting in repeated calls to jump(), which in turn adds, to the player's Y velocity until the max time is reached. While the double jump logic depends on the player pressing jump a second time while the player is in the air.

Now, I had thought that I could possibly wait for the player to complete the apex of the original jump before allowing the second jump to occur, but I am not quite sure how to implement this with the PSK framework.

What I am looking for is a good solution to accomodate both functions, or possibly to work it out with the community on this thread. Any help is appreciated.

#1
04/19/2010 (4:06 am)
When the player reaches the apex of their jump their vertical speed will be zero. Probably you will want to allow some wiggle room so that double jumping is not insanely hard for the player to time, so check for vertctical speed being zero plus/minus some wiggle room value.
#2
04/19/2010 (5:44 am)
Thanks Duncan, but I actually got it working yesterday. I just didn't have time to post something up.

When I have time this week, I am going to post what I did as a resource, so it will hopefully help someone else out.
#3
06/12/2010 (6:39 am)
@Jason - Do you think you could post your solution to this please? Thanks!