Tracking enemies per UID in array

Get help using Construct 2

Post » Thu Nov 13, 2014 6:25 pm

Hi,
i want to spawn enemies in waves and trigger events when all enemies of a wave are dead. I'm thinking to store the UID of every spawned enemy in an array and loop through my array to check on whether each enemy is still alive.
I'm guessing I have a syntax error somewhere, cos it's currently not working and I'm not too sure I'm using the array commands correctly. So can someone please tell me where I'm wrong:

Upon spawning I store the object's UID in the array, expanding it for new entries:
StoreUIDwhenSpawning.PNG


I track my enemies by checking on each of them in a loop:
RemoveUIDifDead.PNG
You do not have the required permissions to view the files attached to this post.
B
13
S
6
Posts: 222
Reputation: 1,859

Post » Fri Nov 14, 2014 5:31 am

If you just want to trigger when all enemies of a wave are dead just use enemy.count. assuming you destroy your enemies
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests