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

@@ -174,8 +174,8 @@ void GameLogo::handleCoffeeCrisisFinished(float deltaTime) {
}
void GameLogo::handleArcadeEditionMoving(float deltaTime) {
// DeltaTime puro: decremento por milisegundo
zoom_ -= (ZOOM_DECREMENT_PER_MS * ZOOM_FACTOR) * deltaTime;
// DeltaTime en segundos: decremento por segundo
zoom_ -= (ZOOM_DECREMENT_PER_S * ZOOM_FACTOR) * deltaTime;
arcade_edition_sprite_->setZoom(zoom_);
if (zoom_ <= 1.0F) {
@@ -196,8 +196,8 @@ void GameLogo::handleArcadeEditionShaking(float deltaTime) {
void GameLogo::processShakeEffect(SmartSprite* primary_sprite, SmartSprite* secondary_sprite, float deltaTime) {
shake_.time_accumulator += deltaTime;
if (shake_.time_accumulator >= SHAKE_DELAY_MS) {
shake_.time_accumulator -= SHAKE_DELAY_MS;
if (shake_.time_accumulator >= SHAKE_DELAY_S) {
shake_.time_accumulator -= SHAKE_DELAY_S;
const auto DISPLACEMENT = calculateShakeDisplacement();
primary_sprite->setPosX(shake_.origin + DISPLACEMENT);
if (secondary_sprite != nullptr) {
@@ -208,8 +208,8 @@ void GameLogo::processShakeEffect(SmartSprite* primary_sprite, SmartSprite* seco
}
void GameLogo::processArcadeEditionShake(float deltaTime) {
// Delay fijo en milisegundos (shake_.delay era frames, ahora usamos constante)
float delayTime = SHAKE_DELAY_MS;
// Delay fijo en segundos (shake_.delay era frames, ahora usamos constante)
float delayTime = SHAKE_DELAY_S;
shake_.time_accumulator += deltaTime;
@@ -267,7 +267,7 @@ void GameLogo::enable() {
// Indica si ha terminado la animación
auto GameLogo::hasFinished() const -> bool {
return post_finished_timer_ >= post_finished_delay_ms_;
return post_finished_timer_ >= post_finished_delay_s_;
}
// Calcula el desplazamiento vertical inicial