So I'm new here and I want to know how to have an actor randomly spawn whenever another actor is killed, eaten, etc
if (getObjects(OtherActor.class).isEmpty() && Greenfoot.getRandomNumber(150) == 0)
{
int x = Greenfoot.getRandomNumber(getWidth());
int y = Greenfoot.getRandomNumber(getHeight());
addObject(new OtherActor(), x, y);
}