canvi de pc (toquejant Options)

This commit is contained in:
2025-06-14 16:28:36 +02:00
parent 4b8cc67b5c
commit 23e8f90274
27 changed files with 505 additions and 454 deletions

View File

@@ -52,8 +52,8 @@ Game::Game(int player_id, int current_stage, bool demo)
demo_.enabled = demo;
// Otras variables
section::name = section::Name::GAME;
section::options = section::Options::NONE;
Section::name = Section::Name::GAME;
Section::options = Section::Options::NONE;
Stage::init();
Stage::number = current_stage;
@@ -109,7 +109,7 @@ Game::~Game()
// [Modo JUEGO] Guarda puntuaciones y transita a modo título
auto manager = std::make_unique<ManageHiScoreTable>(options.game.hi_score_table);
manager->saveToFile(Asset::get()->get("score.bin"));
section::attract_mode = section::AttractMode::TITLE_TO_DEMO;
Section::attract_mode = Section::AttractMode::TITLE_TO_DEMO;
Audio::get()->stopMusic();
}
@@ -276,7 +276,7 @@ void Game::updateStage()
else
{
auto text = Resource::get()->getText("04b_25_2x");
const std::string caption = std::to_string(10 - Stage::number) + lang::getText("[GAME_TEXT] 2");
const std::string caption = std::to_string(10 - Stage::number) + Lang::getText("[GAME_TEXT] 2");
createMessage(paths, text->writeToTexture(caption, 1, -4));
}
}
@@ -338,14 +338,14 @@ void Game::updateGameStateGameOver()
if (game_completed_counter_ > 0)
{
// Los jugadores han completado el juego
section::name = section::Name::CREDITS;
Section::name = Section::Name::CREDITS;
}
else
{
// La partida ha terminado con la derrota de los jugadores
section::name = section::Name::HI_SCORE_TABLE;
Section::name = Section::Name::HI_SCORE_TABLE;
}
section::options = section::Options::HI_SCORE_AFTER_PLAYING;
Section::options = Section::Options::HI_SCORE_AFTER_PLAYING;
if (options.audio.enabled)
{
Audio::get()->stopAllSounds();
@@ -1090,7 +1090,7 @@ void Game::disableTimeStopItem()
// Bucle para el juego
void Game::run()
{
while (section::name == section::Name::GAME)
while (Section::name == Section::Name::GAME)
{
#ifndef RECORDING
checkInput();
@@ -1233,7 +1233,7 @@ void Game::checkEvents()
#ifdef DEBUG
checkDebugEvents(event);
#endif
globalEvents::check(event);
GlobalEvents::check(event);
}
}
@@ -1349,7 +1349,7 @@ void Game::checkInput()
}
// Verifica los inputs globales.
globalInputs::check();
GlobalInputs::check();
}
// Verifica si alguno de los controladores ha solicitado una pausa y actualiza el estado de pausa del juego.
@@ -1379,8 +1379,8 @@ void Game::DEMO_handlePassInput()
{
if (input_->checkAnyButtonPressed())
{
section::name = section::Name::TITLE; // Salir del modo demo y regresar al menú principal.
section::attract_mode = section::AttractMode::TITLE_TO_DEMO; // El juego volverá a mostrar la demo
Section::name = Section::Name::TITLE; // Salir del modo demo y regresar al menú principal.
Section::attract_mode = Section::AttractMode::TITLE_TO_DEMO; // El juego volverá a mostrar la demo
return;
}
}
@@ -1689,7 +1689,7 @@ void Game::initDifficultyVars()
// Variables relacionadas con la dificultad
switch (difficulty_)
{
case GameDifficulty::EASY:
case DifficultyCode::EASY:
{
balloon_manager_->setDefaultBalloonSpeed(BALLOON_SPEED[0]);
difficulty_score_multiplier_ = 0.5f;
@@ -1697,7 +1697,7 @@ void Game::initDifficultyVars()
break;
}
case GameDifficulty::NORMAL:
case DifficultyCode::NORMAL:
{
balloon_manager_->setDefaultBalloonSpeed(BALLOON_SPEED[0]);
difficulty_score_multiplier_ = 1.0f;
@@ -1705,7 +1705,7 @@ void Game::initDifficultyVars()
break;
}
case GameDifficulty::HARD:
case DifficultyCode::HARD:
{
balloon_manager_->setDefaultBalloonSpeed(BALLOON_SPEED[4]);
difficulty_score_multiplier_ = 1.5f;
@@ -1727,12 +1727,12 @@ void Game::initPlayers(int player_id)
const int Y = param.game.play_area.rect.h - 30;
players_.emplace_back(std::make_unique<Player>(1, param.game.play_area.first_quarter_x - 15, Y, demo_.enabled, param.game.play_area.rect, player_textures_[0], player_animations_));
players_.back()->setScoreBoardPanel(SCOREBOARD_LEFT_PANEL);
players_.back()->setName(lang::getText("[SCOREBOARD] 1"));
players_.back()->setName(Lang::getText("[SCOREBOARD] 1"));
players_.back()->setController(getController(players_.back()->getId()));
players_.emplace_back(std::make_unique<Player>(2, param.game.play_area.third_quarter_x - 15, Y, demo_.enabled, param.game.play_area.rect, player_textures_[1], player_animations_));
players_.back()->setScoreBoardPanel(SCOREBOARD_RIGHT_PANEL);
players_.back()->setName(lang::getText("[SCOREBOARD] 2"));
players_.back()->setName(Lang::getText("[SCOREBOARD] 2"));
players_.back()->setController(getController(players_.back()->getId()));
// Activa el jugador que coincide con el "player_id"
@@ -1783,7 +1783,7 @@ void Game::updateDemo()
// Si ha terminado el fundido, cambia de sección
if (fade_out_->hasEnded())
{
section::name = section::Name::HI_SCORE_TABLE;
Section::name = Section::Name::HI_SCORE_TABLE;
return;
}
}
@@ -1935,7 +1935,7 @@ void Game::evaluateAndSetMenace()
// Actualiza la velocidad de los globos en funcion del poder acumulado de la fase
void Game::checkAndUpdateBalloonSpeed()
{
if (difficulty_ != GameDifficulty::NORMAL)
if (difficulty_ != DifficultyCode::NORMAL)
return;
const float percent = static_cast<float>(Stage::power) / Stage::get(Stage::number).power_to_complete;