I have created each level but i need to connect the levels together, for example after defeating/destroying the last enemy on the first level i want a code that allows the game to move onto the next screen. how do i do this? :)
if (!getObjects(LevelComplete.class).isEmpty()) Greenfoot.setWorld(new Level3());
if (getObjects(car1..class).isEmpty() && getObjects(car2.class).isEmpty()) addObject(new WorldInformer(), 0, 0);
if (!getObjects(LevelComplete.class).isEmpty())
{
Greenfoot.delay(100);
Greenfoot.setWorld(new Level3());
}