This site requires JavaScript, please enable it in your browser!
Greenfoot back
Ponce09
Ponce09 wrote ...

2017/1/21

Maze runner

Ponce09 Ponce09

2017/1/21

#
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
Super_Hippo Super_Hippo

2017/1/21

#
//in the class of the actor displaying "you win" / "you lose"
public void act()
{
    if (Greenfoot.isKeyDown("space")) Greenfoot.setWorld(new MyWorld());
}
Replace MyWorld with the name of your starting world class.
You need to login to post a reply.