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

2012/3/13

Counter

Greenfoot15 Greenfoot15

2012/3/13

#
i want my game to count down from 30 seconds when the game is started my code i have private int startTime =0; public void Counter() { startTime=System.currentTimeMillis(); } public void act() { { if (startTime != 0 && startTime + 30000 >= System.currentTimeMillis()) //30000 means 30 seconds { startTime = 0; doSomething(); } } } public void doSomething() { Greenfoot.stop(); } but it still wont count..
You need to login to post a reply.