corregit: el mode demo ja funciona correctament
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include <string> // Para string
|
||||
#include <vector> // Para vector
|
||||
|
||||
#include "bullet.h" // Para Bullet
|
||||
#include "bullet.h" // Para Bullet
|
||||
#include "hit.h" // Para Hit
|
||||
#include "item.h" // Para Item, ItemType
|
||||
#include "manage_hiscore_table.h" // Para HiScoreEntry
|
||||
@@ -56,8 +56,8 @@ class Game {
|
||||
static constexpr bool DEMO_ON = true; // Modo demo activado
|
||||
|
||||
// --- Constructor y destructor ---
|
||||
Game(Player::Id player_id, int current_stage, bool demo); // Constructor principal
|
||||
~Game(); // Destructor
|
||||
Game(Player::Id player_id, int current_stage, bool demo_enabled); // Constructor principal
|
||||
~Game(); // Destructor
|
||||
|
||||
// --- Bucle principal ---
|
||||
void run(); // Ejecuta el bucle principal del juego
|
||||
@@ -77,9 +77,9 @@ class Game {
|
||||
static constexpr float HELP_COUNTER_S = 16.667f; // Contador de ayuda (1000 frames a 60fps → segundos)
|
||||
static constexpr float GAME_COMPLETED_START_FADE_S = 8.333f; // Inicio del fade al completar (500 frames → segundos)
|
||||
static constexpr float GAME_COMPLETED_END_S = 11.667f; // Fin del juego completado (700 frames → segundos)
|
||||
static constexpr float GAME_OVER_DURATION_S = 8.5f;
|
||||
static constexpr float TIME_STOPPED_DURATION_S = 6.0f;
|
||||
static constexpr float DEMO_FADE_PRE_DURATION_S = 0.5f;
|
||||
static constexpr float GAME_OVER_DURATION_S = 8.5f;
|
||||
static constexpr float TIME_STOPPED_DURATION_S = 6.0f;
|
||||
static constexpr float DEMO_FADE_PRE_DURATION_S = 0.5f;
|
||||
static constexpr int ITEM_POINTS_1_DISK_ODDS = 10;
|
||||
static constexpr int ITEM_POINTS_2_GAVINA_ODDS = 6;
|
||||
static constexpr int ITEM_POINTS_3_PACMAR_ODDS = 3;
|
||||
@@ -167,35 +167,35 @@ class Game {
|
||||
|
||||
// Estructuras para gestionar flags de eventos basados en tiempo
|
||||
struct GameOverFlags {
|
||||
bool music_fade_triggered = false;
|
||||
bool message_triggered = false;
|
||||
bool fade_out_triggered = false;
|
||||
bool music_fade_triggered = false;
|
||||
bool message_triggered = false;
|
||||
bool fade_out_triggered = false;
|
||||
|
||||
void reset() {
|
||||
music_fade_triggered = false;
|
||||
message_triggered = false;
|
||||
fade_out_triggered = false;
|
||||
}
|
||||
void reset() {
|
||||
music_fade_triggered = false;
|
||||
message_triggered = false;
|
||||
fade_out_triggered = false;
|
||||
}
|
||||
} game_over_flags_;
|
||||
|
||||
struct GameCompletedFlags {
|
||||
bool start_celebrations_triggered = false;
|
||||
bool end_celebrations_triggered = false;
|
||||
bool start_celebrations_triggered = false;
|
||||
bool end_celebrations_triggered = false;
|
||||
|
||||
void reset() {
|
||||
start_celebrations_triggered = false;
|
||||
end_celebrations_triggered = false;
|
||||
}
|
||||
void reset() {
|
||||
start_celebrations_triggered = false;
|
||||
end_celebrations_triggered = false;
|
||||
}
|
||||
} game_completed_flags_;
|
||||
|
||||
struct TimeStoppedFlags {
|
||||
bool color_flash_sound_played = false;
|
||||
bool warning_phase_started = false;
|
||||
bool color_flash_sound_played = false;
|
||||
bool warning_phase_started = false;
|
||||
|
||||
void reset() {
|
||||
color_flash_sound_played = false;
|
||||
warning_phase_started = false;
|
||||
}
|
||||
void reset() {
|
||||
color_flash_sound_played = false;
|
||||
warning_phase_started = false;
|
||||
}
|
||||
} time_stopped_flags_;
|
||||
|
||||
#ifdef _DEBUG
|
||||
@@ -259,11 +259,11 @@ class Game {
|
||||
void demoHandlePlayerInput(const std::shared_ptr<Player>& player, int index); // Procesa entrada de jugador en demo
|
||||
|
||||
// --- Sistema de balas y proyectiles ---
|
||||
void updateBullets(float deltaTime); // Actualiza posición y estado de todas las balas (time-based)
|
||||
void renderBullets(); // Renderiza todas las balas activas
|
||||
void updateBullets(float deltaTime); // Actualiza posición y estado de todas las balas (time-based)
|
||||
void renderBullets(); // Renderiza todas las balas activas
|
||||
void createBullet(int x, int y, Bullet::Type kind, Bullet::Color color, int owner); // Crea una nueva bala
|
||||
void checkBulletCollision(); // Verifica colisiones de todas las balas
|
||||
void freeBullets(); // Libera memoria del vector de balas
|
||||
void checkBulletCollision(); // Verifica colisiones de todas las balas
|
||||
void freeBullets(); // Libera memoria del vector de balas
|
||||
|
||||
// --- Colisiones específicas de balas ---
|
||||
auto checkBulletTabeCollision(const std::shared_ptr<Bullet>& bullet) -> bool; // Detecta colisión bala-Tabe
|
||||
@@ -325,7 +325,7 @@ class Game {
|
||||
|
||||
// --- Modo demostración ---
|
||||
void initDemo(Player::Id player_id); // Inicializa variables para el modo demostración
|
||||
void updateDemo(); // Actualiza lógica específica del modo demo
|
||||
void updateDemo(float deltaTime); // Actualiza lógica específica del modo demo
|
||||
|
||||
// --- Recursos y renderizado ---
|
||||
void setResources(); // Asigna texturas y animaciones a los objetos
|
||||
@@ -346,7 +346,7 @@ class Game {
|
||||
|
||||
// SISTEMA DE GRABACIÓN (CONDICIONAL)
|
||||
#ifdef RECORDING
|
||||
void updateRecording(); // Actualiza variables durante modo de grabación
|
||||
void updateRecording(float deltaTime); // Actualiza variables durante modo de grabación
|
||||
#endif
|
||||
|
||||
// --- Depuración (solo en modo DEBUG) ---
|
||||
|
||||
Reference in New Issue
Block a user