Cooldown

Get help using Construct 2

Post » Fri Jun 22, 2012 10:58 pm

Im new to Construct and after doing some Tutorials im starting on a game. But I have a question. I would like to make it to where I cant constantly spam my attack. I have tried the cooldown plugin but for some reason I cant get it to work. So I need an alternative. And also my my enemy that shoots lightning constantly shoots it. Thanks!
greyson1252012-06-23 03:35:46
B
3
Posts: 6
Reputation: 287

Post » Sat Jun 23, 2012 3:35 am

Do you for something like an automatic weapon? Well, I had the same problem, Mouse>Button Is Down>System Create Object>Bullet

And that would spam the creation of bullets. So what did I do? Well, I created a global var named "CanShoot", then for the first event, I did:

Mouse>Button Is Down>System Create Object>Bullet
                    >System>SetValue>CanShoot to "false"
                    >System>Wait 1
                    >System>SetValue>CanShoot"true"


Then I added a condition to the Mouse>Button Is Down for checking if CanShoot was true or false.
B
10
S
3
G
3
Posts: 45
Reputation: 2,984

Post » Sat Jun 23, 2012 3:51 am

Thanks Very much. But when i add the action >System>SetValue>CanShoot to false it says "Unknown Expression "False" "
B
3
Posts: 6
Reputation: 287

Post » Sat Jun 23, 2012 4:35 am

variable = 0
    - make bullet
    - set variable to 10

variable > 0
    - subtract 1 from variable
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat Jun 23, 2012 6:43 pm

http://www.mediafire.com/?46uhx82q4zlfck4
still cant get it to work heres the download link.
This is just an example not my actual game.
greyson1252012-06-23 19:15:53
B
3
Posts: 6
Reputation: 287

Post » Sun Jun 24, 2012 1:01 am

[QUOTE=greyson125] http://www.mediafire.com/?46uhx82q4zlfck4
still cant get it to work heres the download link.
This is just an example not my actual game.
[/QUOTE]
Works here. Had to change 10 to a bigger value to really notice the difference7Soul2012-06-24 01:02:34
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Sun Jun 24, 2012 5:24 am

Oh my goodness.. I feel stupid thankl you so much for your replies i got it to work!
B
3
Posts: 6
Reputation: 287

Post » Sun Jun 24, 2012 7:28 am

hmm i have another idea of doing this by 1 event :
condition1: if keyboard z pressed:
condition2: system : compare two values ( bullet.count <= 0 )
action : create bullet
action2: wait any seconds
action3: bullet destroy
B
45
S
15
G
6
Posts: 795
Reputation: 11,935


Return to How do I....?

Who is online

Users browsing this forum: MarkThomas and 0 guests