This commit is contained in:
2026-04-11 16:25:56 +02:00
parent 5b2f986d32
commit bb38600aac
57 changed files with 371 additions and 347 deletions

View File

@@ -82,7 +82,7 @@ void MovingPlatform::recalcSegmentLength() {
float dx = path_[to].x - path_[from].x;
float dy = path_[to].y - path_[from].y;
segment_length_ = std::sqrt(dx * dx + dy * dy);
segment_length_ = std::sqrt((dx * dx) + (dy * dy));
}
// Avanza al siguiente segmento
@@ -174,8 +174,8 @@ void MovingPlatform::update(float delta_time) {
int from = getSegmentFrom();
int to = getSegmentTo();
float new_x = path_[from].x + (path_[to].x - path_[from].x) * t;
float new_y = path_[from].y + (path_[to].y - path_[from].y) * t;
float new_x = path_[from].x + ((path_[to].x - path_[from].x) * t);
float new_y = path_[from].y + ((path_[to].y - path_[from].y) * t);
sprite_->setPosX(new_x);
sprite_->setPosY(new_y);
}