SO I've created a game where my shooter(cat) fires ammo at a dog, but i'm having trouble making that once the ammo hits the dog he would be removed and respawn.
Can anyone help with the code?
public void act() { if (getObjects(Dog.class).isEmpty()) {//If your class isn't called Dog you have to use the right classname; addObject(new Dog(), Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()); } }
public class Dog { public void act()
public class Dog extends Actor{ public void act() { } }