How do I Make Shot delay??

Get help using Construct 2

Post » Wed Apr 16, 2014 2:50 am

Sorry :D I'm just a Newbie.. HAHA..

But ,, how can I add a delay on bullet.?. Like when you pressed SPACE, it will shoot a bullet, and wait one second, until you can shoot again.... That you can't shoot 2 bullets, without waiting a second..
Sorry for my wrong grammar.. XDDD

Please explain it step by step.. Thank you :D

I'm Planning to make a Platform Game.. :D
B
5
Posts: 3
Reputation: 233

Post » Wed Apr 16, 2014 3:19 am

There are a couple of ways, either an instance variable for the amount of frames left until you can shoot, a timer, or an instance variable which sets the time with a later event to check if [time] is greater than the variable + something.

For example.
1. I fire, it sets player.firerate to its default, 100.
2. Every frame, decrease (firerate) by 1.
3. When you fire, it checks that player.firerate ≦ 0
Not the best way, but it gets the job done.
Here's a capx.
bullet test.capx
You do not have the required permissions to view the files attached to this post.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Wed Apr 16, 2014 3:25 am

Sumyjkl wrote:There are a couple of ways, either an instance variable for the amount of frames left until you can shoot, a timer, or an instance variable which sets the time with a later event to check if [time] is greater than the variable + something.

For example.
1. I fire, it sets player.firerate to its default, 100.
2. Every frame, decrease (firerate) by 1.
3. When you fire, it checks that player.firerate ≦ 0
Not the best way, but it gets the job done.
Here's a capx.
bullet test.capx


Oh.. THanks :D .. I'm gonna study this.. Thanks
B
5
Posts: 3
Reputation: 233


Return to How do I....?

Who is online

Users browsing this forum: evillair and 15 guests