How do I make the enemy spawn bullets at different timings?

Get help using Construct 2

Post » Sat Oct 22, 2016 1:16 am

The events sheet looks something like this:

System: every 6 seconds enemy: spawn bullet

enemy refers to all the enemies in the map.
B
5
S
1
Posts: 13
Reputation: 351

Post » Sat Oct 22, 2016 2:13 am

What you could do is every: random(4,6) seconds enemy spawn bullet. That would make a bullet spawn between 4 and 6 seconds. Or when the enemy is spawned or when the game starts you could give it an instance value of random(0,6) and have a timer subtracting that value every second. When it reaches zero you could spawn the bullet and reset the timer to 6. Hope that helps.
B
14
S
3
Posts: 55
Reputation: 912

Post » Sat Oct 22, 2016 2:37 am

You have to "pick" the instance you want to act on or else all instances will be picked.

In short you have to figure out a way to single out the instance you want to fire separate from the other instances.

In my prototype space shooter in my sig I used the technique mentioned by currypuff. My basic enemy ship each shoot at a random time.. it works for the most part. Some of my enemies, however, are picked by distance from player and others using a collision with an invisible sprite barrier... you have to figure out what works for your specific need.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
68
S
17
G
8
Posts: 637
Reputation: 9,420

Post » Sat Oct 22, 2016 4:52 am

Ok, thanks!
B
5
S
1
Posts: 13
Reputation: 351


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 36 guests