Can anyone explain to me what a RuntimeException is?
I’m getting it from these bits of code when I try to do something when the secs get to 0 :
t = new Thread(){
public void run() {
while(game_active) {
secs = secs - 1;
try
{
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
};
t.start();
public void update(){
if( secs == 0)
{
GameOver();
}
}
// GameOver
private void GameOver()
{
Dialog.alert("Game Over!");
}
Or if i change it i get an illegalstateexcpetion, however if i use System.exit(0) it simply closes it, no errors.
Any ideas?