I want that if you press run 4 zombies spawning in 4 different places so i make a spawner class wich is blank and only for the coordinates and with this class i want to control the zombie spawning.
So i write in Spawner class.
My Problem is now with that code that it doesn't stop spawning sometimes i get 20 zombies at each place so where is the problem ??
public void act() { for (int i = 0; i<4; i++) { ZombieTop zombieTop = new ZombieTop(); getWorld().addObject(zombieTop, 5, 0); ZombieRight zombieRight = new ZombieRight(); getWorld().addObject(zombieRight, 10, 5); ZombieLeft zombieLeft = new ZombieLeft(); getWorld().addObject(zombieLeft, 0, 5); ZombieBot zombieBot = new ZombieBot(); getWorld().addObject(zombieBot, 5, 10); } }