How do I make it so a bullet can only be fired every 3 sec?

Get help using Construct 2

Post » Fri Feb 06, 2015 9:01 pm

I need help to make a bullet to only be fired every 3 seconds. It's the player who fires the bullet when I press "W". The problem is that i can spray as many bullets as possible. Thanks in advance. -Klungland
B
8
S
1
Posts: 39
Reputation: 542

Post » Fri Feb 06, 2015 9:08 pm

The common trick is to put your keyboard code in a Group and then disable the group and start a timer to enable the group again in 3 seconds.
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Fri Feb 06, 2015 9:15 pm

Here's one way you could do it.
You do not have the required permissions to view the files attached to this post.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Fri Feb 06, 2015 11:15 pm

Thanks for the help, both of you :)
-K
B
8
S
1
Posts: 39
Reputation: 542

Post » Sat Feb 07, 2015 12:49 am

Even simpler :
You do not have the required permissions to view the files attached to this post.
B
44
S
13
G
1
Posts: 14
Reputation: 3,037

Post » Sat Feb 07, 2015 1:18 am

@Gunter
The only problem with your code is that will not spawn a bullet every time the W key is pressed unless its been 3 seconds since the last bullet spawned. So for instance the first time you shoot you'll have to wait 3 seconds to see anything.

@Klungland
You could however combined W pressed and W down to achieve what you want:
You do not have the required permissions to view the files attached to this post.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635


Return to How do I....?

Who is online

Users browsing this forum: beguinner, dop2000, LaDestitute, OBLIVION, yiuyiu6666 and 26 guests