Game Development Community

Tapping

by James Laker (BurNinG) · in Torque Game Engine · 09/08/2004 (12:51 am) · 3 replies

I need my player to jump to the side (with animation) when the strafe key is pressed twice quiclky ala Unreal style...

Has anyone done this or know how to?

Thanx
James

#1
09/09/2004 (9:49 am)
I'd keep track of the last time I saw a strafe move, and and if happens twice in a specified window, do the jump. I'd do the detection on either the client or server - client would be best, I guess, for lag, and then send a commandToServer or maybe stuff it into th emove structure. Server would make sure players can only strafejump every so often, and perform the move if appropriate.
#2
09/10/2004 (6:46 am)
When the right key is pressed, have it change a variable that controls possible character states, and have a schedule to reset it back. Example:

When the right key is presset, call your right action function. There, do something like:

$player.nextAction = "dodgeRight";

Then schedule a funciton that'll change $player.nextAction to "none" or "" after a few milliseconds. Then, in the right action function, add an IF clause and do the proper action if $player.nextAction == "dodgeRight".

Do the same for tapping in other directions. Such scheme can also be used to create key sequences or combos.
#3
09/15/2004 (6:09 am)
You would really need to build it into the move structure rather than just using script and commandToServer so you could predict the dodge movement on the client. Otherwise you would have warping and a big delay from the time you double tap till the time you actually move