This commit is contained in:
2025-10-19 22:01:31 +02:00
parent 16306f2325
commit 2b4523d644
101 changed files with 2058 additions and 1564 deletions

View File

@@ -3,11 +3,11 @@
#include "moving_sprite.hpp" // Para MovingSprite
// Actualiza la posición y comprueba si ha llegado a su destino (time-based)
void SmartSprite::update(float deltaTime) {
void SmartSprite::update(float delta_time) {
if (enabled_) {
MovingSprite::update(deltaTime);
MovingSprite::update(delta_time);
checkMove();
checkFinished(deltaTime);
checkFinished(delta_time);
}
}
@@ -72,15 +72,15 @@ void SmartSprite::checkMove() {
}
// Comprueba si ha terminado (time-based)
void SmartSprite::checkFinished(float deltaTime) {
void SmartSprite::checkFinished(float delta_time) {
// Comprueba si ha llegado a su destino
on_destination_ = (getPosX() == dest_x_ && getPosY() == dest_y_);
if (on_destination_) {
if (finished_delay_ms_ == 0.0f) {
if (finished_delay_ms_ == 0.0F) {
finished_ = true;
} else {
finished_timer_ += deltaTime;
finished_timer_ += delta_time;
if (finished_timer_ >= finished_delay_ms_) {
finished_ = true;
}