Skip to content
Snippets Groups Projects
Commit f6252ae6 authored by Drahomír Karchňák's avatar Drahomír Karchňák
Browse files

#596 RunesGame doesnt crash on pause anymore...

parent af55aebd
Branches
Tags
No related merge requests found
......@@ -204,8 +204,10 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> {
if ((int) getData().getTime() < RunesGameProperties.GAME_TIME && timeBar.getState()!= TimeBar.TimeBarState.FREEZE) {
getData().addTime(delta);
timeBar.setCurrentPercentage(getData().getTime() / (float) RunesGameProperties.GAME_TIME);
if ((int)getData().getTime() > START_SOUND_BOUND && endingSound == null) {
endingSound = getMusic(RunesGameAssets.CLOCK_SOUND);
if ((int)getData().getTime() > START_SOUND_BOUND) {
if(endingSound == null)
endingSound = getMusic(RunesGameAssets.CLOCK_SOUND);
endingSound.play();
}
} else {
......@@ -227,7 +229,7 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> {
timeBar.performStep();
}
}else {
if (endingSound.isPlaying()) endingSound.pause();
if (endingSound != null) endingSound.pause();
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment