How do I Change fire rate of bullets

Get help using Construct 2

Post » Thu May 07, 2015 4:33 pm

Thanks all of you for helping me :D!
I apreciate your help, this comunity is amazing :)
B
5
S
1
Posts: 10
Reputation: 406

Post » Wed May 13, 2015 2:29 am

Hey everybody I'm having the same problem with the bullets I followed step by step what @chrisinfinger wrote but I'm having difficulties finding this :

Add a second condition to Mouse click fire bullet (right click on, above or below the little green arrow on left side of condition space and select add-new condition)
that condition will be hasFired=false.

Is it me or there is something wrong?


What the part in parenthesis is explaining is how to add a second condition to an existing condition, you right click where the tiny arrow is to the left of the first condition but still inside the condition box and the drop down window will easily allow you to add another condition to the existing one... you could also just make another and drag-drop it inside first one, or several other ways...

The hasFired=false is a variable you made (it could be named anything) you add it to condition using System-compare variable for globals or Sprite-compare instance variable for instance variables.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Fri Jun 24, 2016 2:09 pm

Alright so when i go sprite - compare instance variable.. it says < none add an instance variable first> but i added the hasfired = false to my sprite... why isnt it showing up here?

really feel like im missing something here.. i got the rest in there
On mouse click fire bullet
hasFired=true
Wait 1 second
hasFired=false

but adding this sprite - compre instance variable i cant choose hasfired..

so number and text instance variables do show up but not boolean.. is this a bug?
B
7
S
1
Posts: 2
Reputation: 381

Post » Sat Jun 25, 2016 2:03 am

whatever i figured it out.

it would be nice if people would post the solutions they discover that actually work by saying such and such solution worked for me.. or even better just take a screenshot quickly for heavensake or write it out even. That way when someone runs into the same problem you had and needs help they can actually learn something too!

anyways here is what i did:

Make an instance variable for your player sprite. Do this by clicking the sprite image and going to over properties find Instance variables add/edit and create that sucker.. i named mine bulletdelay _but you can name it anything_ and under type change it to boolean and then set the initial value to true.

Events/Conditions:
mouse - on left clicked
playersprite - is boolean instance variable set - bulletdelay

Actions:
playersprite - set bulletdelay to true
playersprite - spawn (bullet)
playersprite - set bulletdelay to false
system - wait x seconds
playersprite - set bulletdelay to true
B
7
S
1
Posts: 2
Reputation: 381

Post » Sat Jun 25, 2016 11:41 am

Image

Here's how I'd do this. You can make the fire-rate an instance variable on the player if you want but I just threw this together in 5 minutes.
B
10
S
6
Posts: 42
Reputation: 1,050

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests