Basically I have a hit box for my enemy and a separate sprite whose position is set to that box on every tick to represent it (I'm under the impression that it's better practice to do this for collision than to use the actual sprite).
So, when the enemy is attacked, I switch an instance variable ("dead") from 0 to 1. Then I have a separate event that runs when the dead variable is 1 (true) to animate the enemy exploding and that destroys both the enemy hit box and the sprite that represents it.
The problem is when I have multiple instances of the enemy, if one of them is attacked, all of them are triggered to die. Do I need separate variables for every instance? How do I do this without creating a big series of events for every single instance of an enemy? Should I not even be using a variable?
Thanks in advance for any help!