revisat hiscore_table.cpp

This commit is contained in:
2025-09-23 11:24:29 +02:00
parent 5e73327b2f
commit c5d6d77ebf
3 changed files with 37 additions and 27 deletions
+8 -3
View File
@@ -30,8 +30,13 @@ class HiScoreTable {
void run();
private:
// --- Constantes ---
static constexpr Uint16 COUNTER_END = 800; // Valor final para el contador
// --- Constantes (en segundos) ---
static constexpr float COUNTER_END_S = 800.0f / 60.0f; // Tiempo final (≈13.33s)
static constexpr float INIT_DELAY_S = 190.0f / 60.0f; // Retraso inicial (≈3.17s)
static constexpr float ENTRY_DELAY_S = 16.0f / 60.0f; // Retraso entre entradas (≈0.27s)
static constexpr float BACKGROUND_CHANGE_S = 150.0f / 60.0f; // Tiempo cambio fondo (≈2.5s)
static constexpr float ANIM_DURATION_S = 80.0f / 60.0f; // Duración animación (≈1.33s)
static constexpr float CLOUDS_SPEED = -6.0f; // Velocidad nubes (pixels/s)
// --- Objetos y punteros ---
SDL_Renderer *renderer_; // El renderizador de la ventana
@@ -44,7 +49,7 @@ class HiScoreTable {
std::vector<Path> paths_; // Vector con los recorridos precalculados
// --- Variables ---
Uint16 counter_ = 0; // Contador
float elapsed_time_ = 0.0f; // Tiempo transcurrido (segundos)
Uint64 last_time_ = 0; // Último timestamp para calcular delta-time
SDL_FRect view_area_; // Parte de la textura que se muestra en pantalla
Fade::Mode fade_mode_; // Modo de fade a utilizar