diff --git a/config/assets.txt b/config/assets.txt index f276589..9f00f19 100644 --- a/config/assets.txt +++ b/config/assets.txt @@ -64,6 +64,7 @@ SOUND|${PREFIX}/data/sound/title.wav SOUND|${PREFIX}/data/sound/voice_aw_aw_aw.wav SOUND|${PREFIX}/data/sound/voice_coffee.wav SOUND|${PREFIX}/data/sound/voice_credit_thankyou.wav +SOUND|${PREFIX}/data/sound/voice_game_over.wav SOUND|${PREFIX}/data/sound/voice_get_ready.wav SOUND|${PREFIX}/data/sound/voice_no.wav SOUND|${PREFIX}/data/sound/voice_power_up.wav diff --git a/data/sound/voice_game_over.wav b/data/sound/voice_game_over.wav new file mode 100644 index 0000000..9b68d3a Binary files /dev/null and b/data/sound/voice_game_over.wav differ diff --git a/source/sections/game.cpp b/source/sections/game.cpp index bc6ac40..cffec06 100644 --- a/source/sections/game.cpp +++ b/source/sections/game.cpp @@ -1043,7 +1043,7 @@ void Game::initPaths() { paths_.emplace_back(createPath(X1, X2, PathType::HORIZONTAL, Y, 80, easeInQuint), 0); } - // Recorrido para el texto de "Last Stage!" o de "X stages left" o "Game Over" (2,3) + // Recorrido para el texto de "Last Stage!" o de "X stages left" (2,3) { const auto &texture = Resource::get()->getTexture("game_text_last_stage"); const auto H = texture->getHeight(); @@ -1093,6 +1093,18 @@ void Game::initPaths() { paths_.emplace_back(createPath(X0, X1, PathType::HORIZONTAL, Y, 80, easeOutQuint), 1.0f); paths_.emplace_back(createPath(X1, X2, PathType::HORIZONTAL, Y, 80, easeInQuint), 0); } + + // Recorrido para el texto de "Game Over" (10,11) + { + const auto &texture = Resource::get()->getTexture("game_text_game_over"); + const auto H = texture->getHeight(); + const int Y0 = param.game.play_area.rect.h - H; + const int Y1 = param.game.play_area.center_y - (H / 2); + const int Y2 = -H; + const int X = param.game.play_area.center_x; + paths_.emplace_back(createPath(Y0, Y1, PathType::VERTICAL, X, 80, easeOutQuint), 2.0f); + paths_.emplace_back(createPath(Y1, Y2, PathType::VERTICAL, X, 80, easeInQuint), 0); + } } // Actualiza las variables de ayuda @@ -1979,19 +1991,27 @@ void Game::handleGameCompletedEvents() { // Maneja eventos de game over usando flag para trigger único void Game::handleGameOverEvents() { - static bool game_over_triggered = false; + static bool game_over_trigger1 = false; + static bool game_over_trigger2 = false; // Resetear if (game_over_timer_ == 0.0f) { - game_over_triggered = false; + game_over_trigger1 = false; + game_over_trigger2 = false; } - if (!game_over_triggered && game_over_timer_ == 0.0f) { - createMessage({paths_.at(2), paths_.at(3)}, Resource::get()->getTexture("game_text_game_over")); + if (!game_over_trigger1 && game_over_timer_ == 0.0f) { Audio::get()->fadeOutMusic(1000); balloon_manager_->setBouncingSounds(true); - game_over_triggered = true; + game_over_trigger1 = true; } + + if (!game_over_trigger2 && game_over_timer_ >= 1.5f) { + createMessage({paths_.at(10), paths_.at(11)}, Resource::get()->getTexture("game_text_game_over")); + playSound("voice_game_over.wav"); + game_over_trigger2 = true; + } + } #ifdef _DEBUG diff --git a/source/sections/game.h b/source/sections/game.h index 4d60331..a9d481f 100644 --- a/source/sections/game.h +++ b/source/sections/game.h @@ -77,9 +77,9 @@ class Game { static constexpr float HELP_COUNTER_S = 16.667f; // Contador de ayuda (1000 frames a 60fps → segundos) static constexpr float GAME_COMPLETED_START_FADE_S = 8.333f; // Inicio del fade al completar (500 frames → segundos) static constexpr float GAME_COMPLETED_END_S = 11.667f; // Fin del juego completado (700 frames → segundos) - static constexpr float GAME_OVER_DURATION_S = 7.0f; // Duración game over (350 frames → segundos) - static constexpr float TIME_STOPPED_DURATION_S = 6.0f; // Duración del tiempo detenido (360 frames → segundos) - static constexpr float DEMO_FADE_PRE_DURATION_S = 0.5f; // Pre-duración del fade en modo demo + static constexpr float GAME_OVER_DURATION_S = 8.5f; + static constexpr float TIME_STOPPED_DURATION_S = 6.0f; + static constexpr float DEMO_FADE_PRE_DURATION_S = 0.5f; static constexpr int ITEM_POINTS_1_DISK_ODDS = 10; static constexpr int ITEM_POINTS_2_GAVINA_ODDS = 6; static constexpr int ITEM_POINTS_3_PACMAR_ODDS = 3;