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

2017/4/26

Stop the world

ali18 ali18

2017/4/26

#
Hello, after i capture all people on the world with the plane, the game over appears, and that is exactly what i wanted, however, how can i stop everything from moving after the game over has appeared and i am still able to click onto try again or main menu?
danpost danpost

2017/4/26

#
Enclose all act method codes except for those dealing with clicking on try again or main menu within an 'if' block to regulate their executions. An example for an Actor subclass might be like this:
public void act()
{
    if (getWorld().getObjects(GameOver.class).isEmpty())
    {
        // act method codes for this Actor subclass here
    }
}
ali18 ali18

2017/4/27

#
Thanks!!
You need to login to post a reply.