button with timed response

Get help using Construct 2

Post » Thu Aug 29, 2013 12:21 am

Hi guys,

i want to make an action move if key is pressed. But i want to set a time during which the key doesn't respond to a repeated pressing. im not sure if its understandable - basicaly i want the action triggered by the button to last 1-2 seconds and in this time i dont want the button to respond when repeatedly pressed. Anyone got an idea?

Thanks!
B
8
S
4
G
1
Posts: 191
Reputation: 1,873

Post » Thu Aug 29, 2013 12:31 am

Yep, I stop spamming by using global variables. In this case, I use a global variable 'Active', which is set to False by default.
When Key is pressed, If 'Active' is False > Set 'Active' to True, Do Action, Wait 2 seconds, Set 'Active' to False. This will only allow key presses when 'Active' is set to false.plinkie2013-08-29 00:32:31
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Thu Aug 29, 2013 12:33 am

If I've understood your needs, this might work:

Works for me, at least

ReanimtedNerd2013-08-29 00:35:31
B
11
S
1
Posts: 40
Reputation: 485

Post » Thu Aug 29, 2013 11:15 am

yup that helped a lot! ):)
B
8
S
4
G
1
Posts: 191
Reputation: 1,873


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests