How would you open a new world subclass to play once the objective has been beaten eg if all of a certain actor have been destroyed
if (getWorld().getObjects(Enemy.class).isEmpty()) { //there are no more Enemy objects in the world; }
if (getWorld().getObjects(Enemy.class).isEmpty()) { //there are no more enemys so you can start the next level; Greenfoot.setWorld(new Level2());//you can add every world subclass here; }