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

2017/1/19

timer

beyondFrustrated beyondFrustrated

2017/1/19

#
how do i show a countdown of two minutes on the screen while the game plays?
Super_Hippo Super_Hippo

2017/1/19

#
The easiest way would probably be this:
//in active world
private int time = 60*120;

//...

public void act()
{
    time--;
    showText(time/60, 100, 100);
    if (time == 0)
    {
        //end the game
    }
}
You need to login to post a reply.