revisant title.cpp (falla el jugador)

This commit is contained in:
2025-09-23 14:13:48 +02:00
parent 3fafff026b
commit 6a223b68ba
5 changed files with 55 additions and 38 deletions

View File

@@ -12,15 +12,15 @@ class Texture;
class GameLogo {
public:
// --- Constantes ---
static constexpr float COFFEE_VEL_Y = 0.15F; // Velocidad Y de coffee sprite (pixels/ms) - 2.5F/16.67
static constexpr float COFFEE_ACCEL_Y = 0.00036F; // Aceleración Y de coffee sprite (pixels/ms²) - 0.1F/(16.67)²
static constexpr float CRISIS_VEL_Y = -0.15F; // Velocidad Y de crisis sprite (pixels/ms) - -2.5F/16.67
static constexpr float CRISIS_ACCEL_Y = -0.00036F; // Aceleración Y de crisis sprite (pixels/ms²) - -0.1F/(16.67)²
static constexpr int CRISIS_OFFSET_X = 15; // Desplazamiento X de crisis sprite
static constexpr int DUST_SIZE = 16; // Tamaño de dust sprites
static constexpr float ZOOM_DECREMENT_PER_MS = 0.006F; // Decremento de zoom por milisegundo (0.1F/16.67ms)
static constexpr float SHAKE_DELAY_MS = 33.34F; // Delay de shake en milisegundos (2 frames * 16.67ms)
static constexpr float POST_FINISHED_FRAME_TIME = 16.67F; // Tiempo entre decrementos del counter (1 frame)
static constexpr float COFFEE_VEL_Y = 0.15F * 1000.0F; // Velocidad Y de coffee sprite (pixels/s) - 0.15F * 1000 = 150 pixels/s
static constexpr float COFFEE_ACCEL_Y = 0.00036F * 1000000.0F; // Aceleración Y de coffee sprite (pixels/s²) - 0.00036F * 1000000 = 360 pixels/s²
static constexpr float CRISIS_VEL_Y = -0.15F * 1000.0F; // Velocidad Y de crisis sprite (pixels/s) - -0.15F * 1000 = -150 pixels/s
static constexpr float CRISIS_ACCEL_Y = -0.00036F * 1000000.0F; // Aceleración Y de crisis sprite (pixels/s²) - -0.00036F * 1000000 = -360 pixels/s²
static constexpr int CRISIS_OFFSET_X = 15; // Desplazamiento X de crisis sprite
static constexpr int DUST_SIZE = 16; // Tamaño de dust sprites
static constexpr float ZOOM_DECREMENT_PER_S = 0.006F * 1000.0F; // Decremento de zoom por segundo (0.006F * 1000 = 6.0F per second)
static constexpr float SHAKE_DELAY_S = 33.34F / 1000.0F; // Delay de shake en segundos (33.34ms / 1000 = 0.03334s)
static constexpr float POST_FINISHED_FRAME_TIME_S = 16.67F / 1000.0F; // Tiempo entre decrementos del counter (16.67ms / 1000 = 0.01667s)
// --- Constructores y destructor ---
GameLogo(int x, int y);
@@ -92,8 +92,8 @@ class GameLogo {
float x_; // Posición X del logo
float y_; // Posición Y del logo
float zoom_ = 1.0F; // Zoom aplicado al texto "ARCADE EDITION"
float post_finished_delay_ms_ = POST_FINISHED_FRAME_TIME; // Retraso final tras animaciones (ms)
float post_finished_timer_ = 0.0f; // Timer acumulado para retraso final (ms)
float post_finished_delay_s_ = POST_FINISHED_FRAME_TIME_S; // Retraso final tras animaciones (s)
float post_finished_timer_ = 0.0f; // Timer acumulado para retraso final (s)
// --- Inicialización ---
void init(); // Inicializa las variables