I have two backgrounds or worlds, one named lol and one named Space. How do I have the background change if a class is empty? This is what I have but it does not work to changing the background.
if(getWorld().getObjects(Frog.class) == null || getWorld().getObjects(Frog.class).isEmpty())
{
{
getWorld().removeObject(this);
setImage(new GreenfootImage("lol.jpg"));
img.scale(850,550);
setLocation(425, 275);
// GreenfootImage img = getImage();
}
Greenfoot.stop();
}

