I am creating a fighting game and I want to know how I can trigger a dash animation once you double click one of the keys.
Edit: never mind :)
I want to do it with my keyboard not the mouse
Develop games in your browser. Powerful, performant & highly capable.
> I want to do it with my keyboard not the mouse
>
on (KEY) pressed
--+is timer "dashwindow" running?
----> Dash
--+else
---->start timer "dashwindow" for 1 second
dashwindow can be adjusted to whatever you want
Or use a variable instead of Timer:
Variable lastKeyPress=0 On key pressed: ...If (time-lastKeyPress)<0.6 // double click .......Set lastKeyPress=0 ...Else // single click .......Set lastKeyPress=time