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

#324 Fixed playing of sounds when changing difficulty.

parent 84f61835
Branches
Tags
No related merge requests found
......@@ -96,8 +96,8 @@ public class GameMenuPage extends MenuPage {
private Music introSound;
//Can we play the step sounds on difficulty change ?
private boolean stepSoundsReady = false;
//Enabled playing sound steps on difficulty change
private boolean stepSoundsEnabled = false;
//Step sounds assets
private Music step_easy_medium, step_medium_easy;
......@@ -372,10 +372,8 @@ public class GameMenuPage extends MenuPage {
difficulty = GameDifficulty.DEFAULT_DIFFICULTY;
}
if(stepSoundsReady) {
if (stepSoundsEnabled) {
playStepSound(gameDifficulty, difficulty);
} else {
stepSoundsReady = true;
}
difficultyChanged(difficulty);
......@@ -393,6 +391,9 @@ public class GameMenuPage extends MenuPage {
});
gameDifficulty = TablexiaSettings.getInstance().getGameDifficulty(game);
dragSwitchListener.switchToStep(gameDifficulty.getDifficultyNumber() - 1);
//Enabling step sounds later
//so it doesn't play 'em when initially setting difficulties from database...
stepSoundsEnabled = true;
}
/**
......@@ -544,4 +545,4 @@ public class GameMenuPage extends MenuPage {
public void setIsFirstLogin(boolean isFirstLogin) {
this.isFirstLogin = isFirstLogin;
}
}
}
\ No newline at end of file
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