ara pots recolocar al jugador en debug amb el ratoli

This commit is contained in:
2025-11-21 21:16:03 +01:00
parent 4fc5947ba7
commit 7479231110
5 changed files with 97 additions and 1 deletions

View File

@@ -887,4 +887,22 @@ auto Player::getProjection(Direction direction, float displacement) -> SDL_FRect
.w = 0.0F,
.h = 0.0F};
}
}
}
#ifdef _DEBUG
// Establece la posición del jugador directamente (debug)
void Player::setDebugPosition(float x, float y) {
x_ = x;
y_ = y;
syncSpriteAndCollider();
}
// Fija estado ON_GROUND, velocidades a 0, actualiza last_grounded_position_ (debug)
void Player::finalizeDebugTeleport() {
vx_ = 0.0F;
vy_ = 0.0F;
state_ = State::ON_GROUND;
last_grounded_position_ = static_cast<int>(y_);
syncSpriteAndCollider();
}
#endif