Added new level sound
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user