Game Development Community

Double button press?

by Michael Layfield · in Torque Game Engine · 05/10/2005 (7:27 am) · 2 replies

Is there anyway to make a double key press do a different action kinda like pressing LEFT will make my character walk but pressing LEFT twice will make my character dash? Cuz I need to put this feature in a game I'm developing.

#1
05/10/2005 (10:55 am)
I'm no expert, but I don't think so. You'll probably have to build some kind of "last press" detection into the mapped action, and have to do Something Else when the last action was less than X time ago.

Making X a constant or even configurable wouldn't hurt either. Typing "300" (in milli's right?) in a half-dozen places stinks when you decide that "250" would be better.
#2
05/10/2005 (12:48 pm)
Mark sounds like he's on the right track. You could do it in script (easier) or do it right in the actionmap (sim/actionmap.cc).