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..