posat orden en defaults i defines

This commit is contained in:
2025-11-21 09:30:33 +01:00
parent 0fb986d7c4
commit 6bf26f7470
18 changed files with 307 additions and 297 deletions

View File

@@ -364,22 +364,22 @@ void Player::moveFalling(float delta_time) {
// Comprueba si está situado en alguno de los cuatro bordes de la habitación
void Player::handleBorders() {
if (x_ < PLAY_AREA_LEFT) {
if (x_ < PlayArea::LEFT) {
border_ = Room::Border::LEFT;
is_on_border_ = true;
}
else if (x_ + WIDTH > PLAY_AREA_RIGHT) {
else if (x_ + WIDTH > PlayArea::RIGHT) {
border_ = Room::Border::RIGHT;
is_on_border_ = true;
}
else if (y_ < PLAY_AREA_TOP) {
else if (y_ < PlayArea::TOP) {
border_ = Room::Border::TOP;
is_on_border_ = true;
}
else if (y_ + HEIGHT > PLAY_AREA_BOTTOM) {
else if (y_ + HEIGHT > PlayArea::BOTTOM) {
border_ = Room::Border::BOTTOM;
is_on_border_ = true;
}
@@ -393,25 +393,25 @@ void Player::handleBorders() {
void Player::switchBorders() {
switch (border_) {
case Room::Border::TOP:
y_ = PLAY_AREA_BOTTOM - HEIGHT - TILE_SIZE;
y_ = PlayArea::BOTTOM - HEIGHT - Tile::SIZE;
// CRÍTICO: Resetear last_grounded_position_ para evitar muerte falsa por diferencia de Y entre pantallas
last_grounded_position_ = static_cast<int>(y_);
transitionToState(State::ON_GROUND); // TODO: Detectar si debe ser ON_SLOPE
break;
case Room::Border::BOTTOM:
y_ = PLAY_AREA_TOP;
y_ = PlayArea::TOP;
// CRÍTICO: Resetear last_grounded_position_ para evitar muerte falsa por diferencia de Y entre pantallas
last_grounded_position_ = static_cast<int>(y_);
transitionToState(State::ON_GROUND); // TODO: Detectar si debe ser ON_SLOPE
break;
case Room::Border::RIGHT:
x_ = PLAY_AREA_LEFT;
x_ = PlayArea::LEFT;
break;
case Room::Border::LEFT:
x_ = PLAY_AREA_RIGHT - WIDTH;
x_ = PlayArea::RIGHT - WIDTH;
break;
default: