Hello, I have made it so that every time I reset the world, actors will randomly spawn. Everything is working fine. But I want the actors to respawn randomly when they have been eaten.
If it helps, this is the code:
for(int i = 0; i < 15; i++)
{
int x = Greenfoot.getRandomNumber(getWidth() - 1);
int y = Greenfoot.getRandomNumber(getHeight() - 1);
addObject(new Ant(), x, y);
}

