i want a timer of 21 secounds. aftter the timer the reset(); from the world should be used:
public void time()
{
######TIMER backwarts From 21 SECONDS to 0######
if(timer == 0)
{
reset();
}
}


1 | startTime = System.currentTimeMillis(); |
1 2 3 4 5 | if (startTime != 0 && startTime <= System.currentTimeMillis() + 21000 ) { startTime = 0 ; reset(); } |
1 | startTime = System.currentTimeMillis(); |
1 2 3 4 5 | if (startTime != 0 && startTime <= System.currentTimeMillis() + 21000 ) { startTime = 0 ; reset(); } |
1 2 3 4 5 6 7 8 9 | starttime = 0 ; //replace constant with FPS you've obtained from the FPS class * 21 public void time() if (starttime >= constant) { starttime = 0 ; reset(); } |