This commit is contained in:
2026-04-05 23:47:54 +02:00
parent 25ecc74251
commit c4a26ffa0f
96 changed files with 457 additions and 307 deletions

View File

@@ -65,6 +65,7 @@ void Player::handleInput() {
}
wanna_jump_ = Input::get()->checkAction(InputAction::JUMP);
wanna_down_ = Input::get()->checkAction(InputAction::DOWN);
}
// La lógica de movimiento está distribuida en move
@@ -189,6 +190,13 @@ void Player::updateOnSlope(float delta_time) {
startJump();
return;
}
// DOWN: dejarse caer atravesando la rampa
if (wanna_down_) {
y_ += 1.0F;
vy_ = 0.0F;
transitionToState(State::ON_AIR);
return;
}
handleShouldFall();
}

View File

@@ -103,6 +103,7 @@ class Player {
Direction wanna_go_ = Direction::NONE;
bool wanna_jump_ = false;
bool wanna_down_ = false;
// --- Variables de estado ---
State state_ = State::ON_GROUND; // Estado en el que se encuentra el jugador. Util apara saber si está saltando o cayendo