Tracking enemies per UID in array

  • 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:

    [attachment=1:2dbjs0mp][/attachment:2dbjs0mp]

    I track my enemies by checking on each of them in a loop:

    [attachment=0:2dbjs0mp][/attachment:2dbjs0mp]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you just want to trigger when all enemies of a wave are dead just use enemy.count. assuming you destroy your enemies

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)