ID:1122237
 
Okay, so I'm currently playing around with Forum Account's action RPG framework, and I was trying to incorporate my own running system into it. Basically, whenever I double-tap an arrow direction within the span of a third of a second, I want the user to move faster until I release the key (Pretty simple, right?). I tried many different procs to get the player to do this, but it just doesn't seem to work. The code I'm posting here made the user run without stopping once I released the key.

Any help?
Code:
key_down(k)
..()

if(k == "r")
base_speed = base_speed+10
else
base_speed = 4


Problem description: I want to make a double-tap running system.

Use a temporary variable, like running = FALSE. In key_down(), if they double-tapped it fast enough, set running = TRUE. Then in the movement()? (I haven't touched that library in a while, but I know it uses a multitude of procs for movement. Try to figure out the best one to use here. Process of elimination) proc, change the speed depending on whether running = TRUE or not.

Obviously set running = FALSE again on key_up().
Okay, I got the running var down, but how do I store in a var how much time has passed since key_down has pressed a directional key?
You can store the world.time variable and then compare the old value to the current world.time, and do the mathematical operation to get the time elapsed.