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

@@ -55,23 +55,23 @@ void MovingSprite::stop() {
}
// Mueve el sprite (time-based)
void MovingSprite::move(float deltaTime) {
void MovingSprite::move(float delta_time) {
// DeltaTime puro: velocidad (pixels/ms) * tiempo (ms)
x_ += vx_ * deltaTime;
y_ += vy_ * deltaTime;
x_ += vx_ * delta_time;
y_ += vy_ * delta_time;
// Aceleración (pixels/ms²) * tiempo (ms)
vx_ += ax_ * deltaTime;
vy_ += ay_ * deltaTime;
vx_ += ax_ * delta_time;
vy_ += ay_ * delta_time;
pos_.x = static_cast<int>(x_);
pos_.y = static_cast<int>(y_);
}
// Actualiza las variables internas del objeto (time-based)
void MovingSprite::update(float deltaTime) {
move(deltaTime);
rotate(deltaTime);
void MovingSprite::update(float delta_time) {
move(delta_time);
rotate(delta_time);
}
// Muestra el sprite por pantalla
@@ -80,9 +80,9 @@ void MovingSprite::render() {
}
// Establece la rotacion (time-based)
void MovingSprite::rotate(float deltaTime) {
void MovingSprite::rotate(float delta_time) {
if (rotate_.enabled) {
rotate_.angle += rotate_.amount * deltaTime;
rotate_.angle += rotate_.amount * delta_time;
}
}