delta-time: title.cpp

This commit is contained in:
2025-09-16 20:23:10 +02:00
parent 470a07d28c
commit 49e30f947a
9 changed files with 114 additions and 46 deletions

View File

@@ -122,8 +122,8 @@ void AnimatedSprite::animate(float deltaTime) {
return;
}
// Convertir speed (frames) a tiempo: speed frames = speed/60 segundos a 60fps
float frameTime = static_cast<float>(animations_[current_animation_].speed) / 60.0f;
// Convertir speed (frames) a tiempo: speed frames = speed * (1000ms/60fps) milisegundos
float frameTime = static_cast<float>(animations_[current_animation_].speed) * (1000.0f / 60.0f);
// Acumular tiempo transcurrido
animations_[current_animation_].time_accumulator += deltaTime;