tenho o seguinte código no loop principal do meu jogo:
while (rodando) {
long start = System.currentTimeMillis();
if (tmrTempoInicio != null) {
if (tempoInicio < 0) {
tmrTempoInicio.cancel();
tmrTempoInicio = null;
}
} else {
input();
construtores();
arqueiros();
flechas();
inserirInimigos();
inimigos();
muralhas();
oleoFervente();
}
renderiza(g);
long end = System.currentTimeMillis();
int duration = (int) (end - start);
if (duration < timeStep) {
try {
Thread.sleep(timeStep - duration);
} catch (InterruptedException ie) {
stop();
}
}
}
Tento pausar da seguinte maneira: