abilities cool down

Get help using Construct 2

Post » Wed Nov 28, 2012 8:18 am

how do i do a cool down timer for special abilities, ive tried system wait but it doesnt seem to work is there anther way?
B
6
Posts: 38
Reputation: 512

Post » Wed Nov 28, 2012 10:22 am

You could try setting a global variable called "cooldown" and set it to 15 when the cool down is used.
Then once the cool down is <= to 15 then set an event that every 1 second subtract 1 from the global variable until it reaches 0 then you can re use the ability.
Hope this helps
B
13
S
2
Posts: 87
Reputation: 1,244

Post » Wed Nov 28, 2012 2:51 pm

It would work better if you did cooldown >= 0 to avoid going into the negatives continuously.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Wed Nov 28, 2012 3:23 pm

Here's a cooldown example I made a while back if you want to have a look at a .capx:

CooldownMAX.capx
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Jun 14, 2013 10:31 pm

Hi, I really like your cool down method - it works good for what I want to try and achieve.

I tried to adapt the cooldown from being a global variable to a instance variable against a sprite(Cannon).

I want to allow each cannon to have its own cooldown. However I just can not seem to get it working..
Has anyone attempted this before, and got it working?

Thanks
B
13
S
4
G
3
Posts: 21
Reputation: 2,134

Post » Thu Sep 05, 2013 11:23 am

@NimTrix

Thanks!
it works when every click abd it has animation cooldown on it?
B
9
S
2
Posts: 82
Reputation: 914


Return to How do I....?

Who is online

Users browsing this forum: WhosWho, Yahoo [Bot] and 16 guests