eliminada repetició en la tecla down

This commit is contained in:
2026-04-07 12:10:12 +02:00
parent 5462b31f96
commit 0f80c1f34a
2 changed files with 5 additions and 1 deletions

View File

@@ -110,7 +110,10 @@ void Player::handleInput() {
const bool JUMP_PRESSED = Input::get()->checkAction(InputAction::JUMP);
wanna_jump_ = JUMP_PRESSED && !jump_held_;
jump_held_ = JUMP_PRESSED;
wanna_down_ = Input::get()->checkAction(InputAction::DOWN);
const bool DOWN_PRESSED = Input::get()->checkAction(InputAction::DOWN);
wanna_down_ = DOWN_PRESSED && !down_held_;
down_held_ = DOWN_PRESSED;
}
// ============================================================================

View File

@@ -100,6 +100,7 @@ class Player {
bool wanna_jump_ = false;
bool wanna_down_ = false;
bool jump_held_ = false;
bool down_held_ = false;
// --- Estado ---
State state_ = State::ON_GROUND;