How can I make sure that I can spawn a number of enemies?

Get help using Construct 2

Post » Tue Oct 03, 2017 8:44 am

Hey, :)

How can I make sure that I can spawn a number of enemies every few seconds and that there are a maximum number of enemies, for example every 3 seconds an enemy spawns and 20 enemies is the maximal, so if I kill some enemies it has no influence on the max number of spawns. After 20 spawned enemies, they wont spawn anymore. :|

sorry for bad English i hope you will understand it :P

thank you in advance ;)
B
7
S
1
Posts: 75
Reputation: 618

Post » Tue Oct 03, 2017 9:13 am

You can use a global variable counter as a condition i.e. spawn enemy while global var less than 20 and add 1 to global var every time one spawns. You could also use the count of the enemy objects, i.e. if enemy.count < 20 then spawn, this counts the number of enemies that exist, but this would only be used if you had a max of 20 at any one time and destroying them affected the count, I don't think that applies here but it's useful to know.
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Tue Oct 03, 2017 11:32 am

Thank You plinkie, It works :)
B
7
S
1
Posts: 75
Reputation: 618


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests