Fase 9b: extraer ContinueSystem de GameScene
GameScene::actualitzar_continue, processar_input_continue y el
helper check_and_apply_continue_timeout (3 funciones, ~140 LOC) salen
a Systems::ContinueScreen en source/game/systems/continue_system.{hpp,cpp}.
API:
- struct Systems::ContinueScreen::Context: agrupa el estado mutable
(state, counter, tick_timer, continues_used, game_over_timer,
lives/score/hit_timer arrays, ships, match_config) y un callback
get_spawn_point inyectado por GameScene.
- update(ctx, dt): avanza countdown automatico y transiciona a
GAME_OVER si timeout.
- processInput(ctx): START revive jugador(es), THRUST/SHOOT acelera
countdown.
Helpers privados (revivePlayer, checkAndApplyTimeout) en anonymous
namespace del .cpp para evitar contaminar el header.
GameOverState ahora con underlying type explicito (uint8_t) para
permitir forward-declaration limpia en continue_system.hpp.
dibuixar_continue y unir_jugador se quedan en GameScene (render y
gameplay normal, no parte del state machine).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "game/stage_system/stage_manager.hpp"
|
||||
|
||||
// Game over state machine
|
||||
enum class GameOverState {
|
||||
enum class GameOverState : uint8_t {
|
||||
NONE, // Normal gameplay
|
||||
CONTINUE, // Continue countdown screen (9→0)
|
||||
GAME_OVER // Final game over (returning to title)
|
||||
@@ -89,9 +89,6 @@ class GameScene {
|
||||
|
||||
// [NEW] Continue & Join system
|
||||
void unir_jugador(uint8_t player_id); // Join inactive player mid-game
|
||||
void processar_input_continue(); // Handle input during continue screen
|
||||
void actualitzar_continue(float delta_time); // Update continue countdown
|
||||
void check_and_apply_continue_timeout(); // Check if continue timed out and transition to GAME_OVER
|
||||
void dibuixar_continue(); // Draw continue screen
|
||||
|
||||
// [NEW] Stage system helpers
|
||||
|
||||
Reference in New Issue
Block a user