I am making a top-down games in wich the player needs to kill zombies. The zombies are spawning in every 5 seconds to a sprite.
When the distance between the player and the zombie is less or equal to 50 the zombie changes its animations because the instance variable changed from "IDLE" to "ATTACK".
My problem is that not just that zombie changes its animation wich is near the player. Every zombie starts to attack when one is near the player.
Here is the game:
(Sorry for my English)