How do I slow down bullet spawn

Get help using Construct 2

Post » Sat Feb 09, 2013 4:31 am

How do I slow down bullet spawn.

When I hold down shoot button it keeps spawning bullets like a water hose out of the shooter.

I want to delay the bullets so they come out slower.

Here is the capx: http://dl.dropbox.com/u/75406771/bb.capx
Hobby app website: http://www.skymillapps.com/
B
10
S
2
Posts: 105
Reputation: 2,114

Post » Sat Feb 09, 2013 5:14 am

There are many ways if you go through the tutorials. A simple one is the wait action.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Sat Feb 09, 2013 5:46 am

Instance Variable for the shooter:
var fireDelay = 0;   // Detect if ready to fire.
var fireRate = 20;   // Speed of fire rate.

When button is holding:
shooter.fireDelay -1
---- If (shooter.fireDelay <= 0)
        {shooter.fireDelay = shooter.fireRate, Fire bullet}

On button release:
shooter.fireDelay = 0

Hope it helps.
B
13
S
5
G
3
Posts: 63
Reputation: 3,989

Post » Sat Feb 09, 2013 7:49 am

You can also try making the bullet spawn when mouse button "X" is held down. Make it spawn like every 0.3-1.0 play around with that a bit. Using the wait action like suggested above is one way to do it.
B
13
S
4
G
4
Posts: 33
Reputation: 2,587


Return to How do I....?

Who is online

Users browsing this forum: Mohicano and 25 guests