How do I change the "fire rate" of bullets?

Get help using Construct 2

Post » Wed Mar 21, 2012 11:29 pm

So I have my bullets set up to shoot when you hold the left mouse button down, which also move the player, but the bullets shoot at a very fast rate. How do I slow down the rate at which the bullets spawn? I am pretty new to this so a very "dumb minded" answer would be perfect haha thanks :)
B
7
S
1
Posts: 97
Reputation: 1,167

Post » Wed Mar 21, 2012 11:37 pm

There was an answer in your other topic, I'll post it here;


Every tick
   add dt to reload

Reload >= 1
   plane shoot bullet
   set reload to 0

dt is just "dt". You can see it under system expressions.
DT, or delta time, is the time between every tick.

Basically, this will shoot something every 1 second. If you want it to shoot
every 2 seconds, set it to 2. Every half second? 0.5.
You want to do it this way so your game is framerate independent.
It's important, since you want your game to run the same at all
framerates.

You can read more about delta time and framerate independence here.

EDIT: I made a capx for you, check it out here.Intrepid2012-03-21 23:49:53
B
12
S
2
G
4
Posts: 44
Reputation: 2,389

Post » Thu Mar 22, 2012 3:06 am

perfect thank you!
B
7
S
1
Posts: 97
Reputation: 1,167

Post » Tue Mar 01, 2016 5:21 pm

My rate oif fire is massive and i cant fix it, it is set to 1 on the object but it fires millions
B
5
Posts: 28
Reputation: 305


Return to How do I....?

Who is online

Users browsing this forum: ETgirl79, Yahoo [Bot] and 13 guests