aplanat sub-bucles anidats de pausa, game over, instruccions i demo (milestone 2)

- Game::runPausedGame() convertit a enterPausedGame() + despatx directe en run()
- Game::runGameOverScreen() convertit a enterGameOverScreen() + despatx directe
- Eliminada variable static postFade, convertida a membre gameOverPostFade
- Extret SDL_PollEvent de updateGameOverScreen() a checkGameOverEvents()
- Game::run() refactoritzat amb iterate() + hasFinished() per preparar callbacks
- Title::runInstructions() i runDemoGame() convertits a no-bloquejants
- Instructions ara usa finished/quitRequested en lloc de modificar section directament
- Instructions exposa start(), update(), checkEvents(), render(), hasFinished()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 19:15:54 +02:00
parent 9365f80e8b
commit 18c4d6032d
7 changed files with 252 additions and 124 deletions

View File

@@ -91,10 +91,16 @@ class Title {
std::vector<int> deviceIndex; // Indice para el jugador [i] del vector de dispositivos de entrada disponibles
// Variables para la vibración del título (SUBSECTION_TITLE_2)
int vibrationStep; // Paso actual de la vibración
int vibrationCoffeeBaseX; // Posición X base del bitmap Coffee
int vibrationCrisisBaseX; // Posición X base del bitmap Crisis
bool vibrationInitialized; // Indica si se han capturado las posiciones base
int vibrationStep; // Paso actual de la vibración
int vibrationCoffeeBaseX; // Posición X base del bitmap Coffee
int vibrationCrisisBaseX; // Posición X base del bitmap Crisis
bool vibrationInitialized; // Indica si se han capturado las posiciones base
// Variables para sub-estados delegados (instrucciones y demo)
bool instructionsActive; // Indica si las instrucciones están activas
bool demoGameActive; // Indica si el juego demo está activo
mode_e instructionsMode; // Modo de las instrucciones activas
bool demoThenInstructions; // Indica si tras la demo hay que mostrar instrucciones
// Inicializa los valores
void init();