How to limit number of enemies spawned?

Get help using Construct 2

Post » Sat Jan 18, 2014 10:11 pm

So I use this event to spawn enemies, what will be the simplest and easiest way to limit the number of enemies spawned?

Image
B
20
S
4
Posts: 382
Reputation: 2,964

Post » Sat Jan 18, 2014 11:11 pm

With a loop.

For "loop"
from 0
to (number of enemies you want to spawn) > Spawn Walker.

You can use the random expression in the second parameter if you are doing waves of enemies and want them to be varied and not always the same number.
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Sun Jan 19, 2014 12:50 am

I am also wanting another to spawn if I get under that set number so if one gets killed, another will replace it. In your example above, would that be using the "for each (ordered)" condition?
Image
B
20
S
4
Posts: 382
Reputation: 2,964

Post » Sun Jan 19, 2014 12:56 am

Simply add another condition to your spawning code that says

Compare 2 values -> Enemies.count < 20

Thus it will only spawn enemies if the total amount of enemies active are less than 20.

B
83
S
40
G
15
Posts: 987
Reputation: 16,847

Post » Sun Jan 19, 2014 12:58 am

glad I found this post...
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Sun Jan 19, 2014 3:57 pm

@justifun Thanks! Simple and perfect!
Image
B
20
S
4
Posts: 382
Reputation: 2,964


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests