I usually have a start of code, but on this one I’m pretty stumped. I have it so if you destroy all four enemies you win, but I need to know how to count the enemies destroyed. I’m guessing array and/or Hashtable but I’m not to familiar with either of those and I’m just looking for a heading, hints, or advice, thanks so much in advance
Set up a script with a global variable such as “enemiesRemaing.” If you spawn enemies pragmatically, increment this variable once for each enemy spawn, or if you have dragged and dropped them into the scene, simply set this number to the number of enemies (4).
Inside your “destroyEnemy” function, decrement this variable. Then, when this variable equals zero, all the enemies are destroyed.
At least, that’s how I would do it.
Have a variable to act as a counter in your main script like
int EnemyAlive = 4;
When you kill one… decrease it by one.
If you instantiate a new enemy, increase it by one.
facepalm And here I was over-thinking about Array’s Thanks so much, I’ll get right on that!