Hey guys well I'm making a game and I can't get to make the you lost or you win screen back to the main screen.. what I'm trying to ask is if y'all have the code to make the screen go from a "you lost" screen to the beginning by just pressing space
//in the class of the actor displaying "you win" / "you lose"
public void act()
{
if (Greenfoot.isKeyDown("space")) Greenfoot.setWorld(new MyWorld());
}