retocat el timing de la seqüencia final

This commit is contained in:
2025-03-16 13:36:57 +01:00
parent bfb334bef0
commit 336c3119ff
3 changed files with 8 additions and 29 deletions

View File

@@ -145,38 +145,14 @@ void Credits::checkInput()
// Comprueba si se ha pulsado cualquier botón (de los usados para jugar) // Comprueba si se ha pulsado cualquier botón (de los usados para jugar)
if (Input::get()->checkAnyButtonPressed(INPUT_ALLOW_REPEAT)) if (Input::get()->checkAnyButtonPressed(INPUT_ALLOW_REPEAT))
{ {
if (mini_logo_on_position_) want_to_pass_ = true;
{ fading_ = 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;
}
} }
else else
{ {
want_to_pass_ = false; 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 // Comprueba los inputs que se pueden introducir en cualquier sección del juego
globalInputs::check(); globalInputs::check();
} }

View File

@@ -55,7 +55,7 @@ Director::Director(int argc, const char *argv[])
section::name = section::Name::GAME; section::name = section::Name::GAME;
section::options = section::Options::GAME_PLAY_1P; section::options = section::Options::GAME_PLAY_1P;
#elif DEBUG #elif DEBUG
section::name = section::Name::LOGO; section::name = section::Name::GAME;
#else // NORMAL GAME #else // NORMAL GAME
section::name = section::Name::LOGO; section::name = section::Name::LOGO;
section::options = section::Options::NONE; section::options = section::Options::NONE;

View File

@@ -359,6 +359,9 @@ void Game::updateGameStateGameOver()
// Gestiona eventos para el estado del final del juego // Gestiona eventos para el estado del final del juego
void Game::updateGameStateCompleted() void Game::updateGameStateCompleted()
{ {
constexpr int START_CELEBRATIONS = 400;
constexpr int END_CELEBRATIONS = START_CELEBRATIONS + 300;
updatePlayers(); updatePlayers();
updateScoreboard(); updateScoreboard();
updateBackground(); updateBackground();
@@ -383,7 +386,7 @@ void Game::updateGameStateCompleted()
// Comienza las celebraciones // Comienza las celebraciones
// Muestra el mensaje de felicitación y da los puntos a los jugadores // 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(4), paths_.at(5)}, Resource::get()->getTexture("game_text_congratulations"));
createMessage({paths_.at(6), paths_.at(7)}, Resource::get()->getTexture("game_text_1000000_points")); createMessage({paths_.at(6), paths_.at(7)}, Resource::get()->getTexture("game_text_1000000_points"));
@@ -403,7 +406,7 @@ void Game::updateGameStateCompleted()
} }
// Termina las celebraciones // Termina las celebraciones
if (game_completed_counter_ == 500) if (game_completed_counter_ == END_CELEBRATIONS)
{ {
for (auto &player : players_) for (auto &player : players_)
{ {