From 336c3119ffc7294297e5e098fc05fe8352501577 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sun, 16 Mar 2025 13:36:57 +0100 Subject: [PATCH] =?UTF-8?q?retocat=20el=20timing=20de=20la=20seq=C3=BCenci?= =?UTF-8?q?a=20final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/credits.cpp | 28 ++-------------------------- source/director.cpp | 2 +- source/game.cpp | 7 +++++-- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/source/credits.cpp b/source/credits.cpp index 0d2f7a5..4ebdad7 100644 --- a/source/credits.cpp +++ b/source/credits.cpp @@ -145,38 +145,14 @@ void Credits::checkInput() // Comprueba si se ha pulsado cualquier botón (de los usados para jugar) if (Input::get()->checkAnyButtonPressed(INPUT_ALLOW_REPEAT)) { - if (mini_logo_on_position_) - { - // Si el mini_logo ha llegado a su posición final, al pulsar cualquier tecla se activa el fundido - fading_ = true; - want_to_pass_ = true; - } - else - { - // Si todavía estan los creditos en marcha, se pasan solos a toda pastilla - want_to_pass_ = true; - } + want_to_pass_ = true; + fading_ = mini_logo_on_position_; } else { want_to_pass_ = false; } - // Comprueba si se pulsa algun boton de disparo para acabar con el minilogo y empezar el fade - if (mini_logo_on_position_) - { - for (int i = 0; i < Input::get()->getNumControllers(); ++i) - { - // Salir - if (Input::get()->checkInput(InputType::FIRE_CENTER, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) && - Input::get()->checkInput(InputType::FIRE_LEFT, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) && - Input::get()->checkInput(InputType::FIRE_RIGHT, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i)) - { - fading_ = true; - } - } - } - // Comprueba los inputs que se pueden introducir en cualquier sección del juego globalInputs::check(); } diff --git a/source/director.cpp b/source/director.cpp index d82fc3f..9eb7e6d 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -55,7 +55,7 @@ Director::Director(int argc, const char *argv[]) section::name = section::Name::GAME; section::options = section::Options::GAME_PLAY_1P; #elif DEBUG - section::name = section::Name::LOGO; + section::name = section::Name::GAME; #else // NORMAL GAME section::name = section::Name::LOGO; section::options = section::Options::NONE; diff --git a/source/game.cpp b/source/game.cpp index 2752a60..ddf7eb0 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -359,6 +359,9 @@ void Game::updateGameStateGameOver() // Gestiona eventos para el estado del final del juego void Game::updateGameStateCompleted() { + constexpr int START_CELEBRATIONS = 400; + constexpr int END_CELEBRATIONS = START_CELEBRATIONS + 300; + updatePlayers(); updateScoreboard(); updateBackground(); @@ -383,7 +386,7 @@ void Game::updateGameStateCompleted() // Comienza las celebraciones // Muestra el mensaje de felicitación y da los puntos a los jugadores - if (game_completed_counter_ == 200) + if (game_completed_counter_ == START_CELEBRATIONS) { createMessage({paths_.at(4), paths_.at(5)}, Resource::get()->getTexture("game_text_congratulations")); createMessage({paths_.at(6), paths_.at(7)}, Resource::get()->getTexture("game_text_1000000_points")); @@ -403,7 +406,7 @@ void Game::updateGameStateCompleted() } // Termina las celebraciones - if (game_completed_counter_ == 500) + if (game_completed_counter_ == END_CELEBRATIONS) { for (auto &player : players_) {