How do I do trigger an even with Double-Click.

Get help using Construct 2

Post » Thu Jul 10, 2014 6:11 pm

Hi all,
How do I trigger an action by double-clicking a key on the keyboard?
the idea is that by pressing W the player walks and by double-clicking W the player runs.
Any contribution would be appreciated.
Last edited by rikk on Thu Jul 10, 2014 8:33 pm, edited 1 time in total.
B
4
Posts: 10
Reputation: 220

Post » Thu Jul 10, 2014 8:31 pm

Not help here?
B
4
Posts: 10
Reputation: 220

Post » Thu Jul 10, 2014 8:43 pm

use a counter to know how long ago that key was released, if the player press it again before a limit time, it is a double press.
something like

var timer = 0
var timerLimit = 0.3(seconds)

on D key released set timer to timerLimit.

every tick > subtract dt(deltatime) from timer.

on D pressed if timer > 0 = seconds press (within limit)
else
first press
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Jul 10, 2014 9:30 pm

Thanks a lot!
I'll try it out now.
B
4
Posts: 10
Reputation: 220


Return to How do I....?

Who is online

Users browsing this forum: justifun, wizdigitech, Yahoo [Bot] and 8 guests