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
No related merge requests found
...@@ -204,8 +204,10 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> { ...@@ -204,8 +204,10 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> {
if ((int) getData().getTime() < RunesGameProperties.GAME_TIME && timeBar.getState()!= TimeBar.TimeBarState.FREEZE) { if ((int) getData().getTime() < RunesGameProperties.GAME_TIME && timeBar.getState()!= TimeBar.TimeBarState.FREEZE) {
getData().addTime(delta); getData().addTime(delta);
timeBar.setCurrentPercentage(getData().getTime() / (float) RunesGameProperties.GAME_TIME); timeBar.setCurrentPercentage(getData().getTime() / (float) RunesGameProperties.GAME_TIME);
if ((int)getData().getTime() > START_SOUND_BOUND && endingSound == null) { if ((int)getData().getTime() > START_SOUND_BOUND) {
endingSound = getMusic(RunesGameAssets.CLOCK_SOUND); if(endingSound == null)
endingSound = getMusic(RunesGameAssets.CLOCK_SOUND);
endingSound.play(); endingSound.play();
} }
} else { } else {
...@@ -227,7 +229,7 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> { ...@@ -227,7 +229,7 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> {
timeBar.performStep(); timeBar.performStep();
} }
}else { }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