bug fix: en la tabla de puntuacions, no apareix la estreleta al completar el joc amb 1CC

bug fix: posant nom al completar el joc, si "passes" el mostrar el nom, mata al jugador en lloc de fer que se'n vaja

Resol #92 i #98
This commit is contained in:
2025-08-26 08:21:33 +02:00
parent c85336a4d0
commit 057d3dcfee
6 changed files with 89 additions and 64 deletions

View File

@@ -170,7 +170,7 @@ class Player {
[[nodiscard]] static auto getWidth() -> int { return WIDTH; }
[[nodiscard]] auto getPlayingState() const -> State { return playing_state_; }
[[nodiscard]] auto getName() const -> const std::string & { return name_; }
[[nodiscard]] auto get1CC() const -> bool { return game_completed_ && credits_used_ == 1; }
[[nodiscard]] auto get1CC() const -> bool { return game_completed_ && credits_used_ <= 1; }
[[nodiscard]] auto getEnterNamePositionOverflow() const -> bool { return enter_name_ ? enter_name_->getPositionOverflow() : false; }
// Setters inline
@@ -186,6 +186,7 @@ class Player {
void setWalkingState(State state) { walking_state_ = state; }
void addCredit();
void passShowingName();
void setGamepad(std::shared_ptr<Input::Gamepad> gamepad) { gamepad_ = std::move(gamepad); }
[[nodiscard]] auto getGamepad() const -> std::shared_ptr<Input::Gamepad> { return gamepad_; }
void setUsesKeyboard(bool value) { uses_keyboard_ = value; }