Added new level sound

This commit is contained in:
2025-11-30 10:37:35 +01:00
parent 69b2521695
commit 5fd77fdaf0
7 changed files with 219 additions and 5 deletions

View File

@ -807,7 +807,11 @@ int main(int, char **)
loadSoundWithFallback("boom_tetris", "boom_tetris");
loadSoundWithFallback("wonderful", "wonderful");
loadSoundWithFallback("lets_go", "lets_go"); // For level up
loadSoundWithFallback("hard_drop", "hard_drop_001");
loadSoundWithFallback("new_level", "new_level");
bool suppressLineVoiceForLevelUp = false;
auto playVoiceCue = [&](int linesCleared) {
const std::vector<std::string>* bank = nullptr;
switch (linesCleared) {
@ -835,12 +839,16 @@ int main(int, char **)
SoundEffectManager::instance().playSound("clear_line", 1.0f);
// Layer a voiced callout based on the number of cleared lines
playVoiceCue(linesCleared);
if (!suppressLineVoiceForLevelUp) {
playVoiceCue(linesCleared);
}
suppressLineVoiceForLevelUp = false;
});
game.setLevelUpCallback([&](int newLevel) {
// Play level up sound
SoundEffectManager::instance().playSound("lets_go", 1.0f); // Increased volume
SoundEffectManager::instance().playSound("new_level", 1.0f);
SoundEffectManager::instance().playSound("lets_go", 1.0f); // Existing voice line
suppressLineVoiceForLevelUp = true;
});
AppState state = AppState::Loading;