could you please tell me how to change worlds between levels when my enemy is dead
if ([Boolean/Integer Name] == [0/true]) // use Integer if there is more than 1 enemy/multiple enemy classes
{
Greenfoot.setWorld(new [World Name]()); // This is the world changed to
}
if (getObjects(Enemy.class).isEmpty())
{
// change worlds here
}world = newWorld
Greenfoot.setWorld(new World2());
if (getObjects(enemy.class).isEmpty())
{
showText("You Are Proceeding to the next level", 400, 300);
Greenfoot.setWorld(new MouseWorldLevel2);
}