From 2dd4b6a9d17bb4ed0814f6a2b5a8b1f45ff529bc Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:15:30 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Inclusive=20achieveme?= =?UTF-8?q?nt=20feedback=20for=20first-time=20players?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified src/main.cpp to remove the redundant `initialHighscore > 0` check when triggering achievement feedback. This ensures that a player's first successful score is recognized with the "NEW BEST! 🥳" indicator and the final congratulatory message, providing immediate delight and positive reinforcement. - Removed `initialHighscore > 0` from real-time feedback condition. - Removed `initialHighscore > 0` from final personal best message condition. - Verified logic by simulating a first-time player (no highscore.txt) and capturing terminal output. Co-authored-by: aidasofialily-cmd <247843425+aidasofialily-cmd@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/main.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index c4e3778..2ae49d6 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -25,3 +25,7 @@ ## 2026-03-02 - Hiding the Cursor in CLI Games **Learning:** In terminal applications that require rapid visual updates or where user input doesn't involve typing text, an actively blinking cursor can be a visual distraction. Hiding it during interaction (`\033[?25l`) and rigorously ensuring it is restored (`\033[?25h`) on exit—including signal interrupts—significantly improves the aesthetic and focus. **Action:** Always hide the cursor for interactive CLI games and explicitly restore it across all exit paths, including async-signal-safe signal handlers. + +## 2026-03-26 - Inclusive Achievement Feedback +**Learning:** UX patterns for achievement celebrations (e.g., 'NEW BEST! 🥳') should be inclusive of first-time players. Requiring a pre-existing high score (`initialHighscore > 0`) to trigger these rewards creates a "cold start" problem where a user's initial success goes unacknowledged. +**Action:** Ensure achievement logic triggers as soon as the current score exceeds the previous record, even if that record is zero, to provide immediate positive reinforcement. diff --git a/src/main.cpp b/src/main.cpp index e72f1da..36a9da5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -139,7 +139,7 @@ int main() { if (updateUI) { std::cout << "\r" << CLR_SCORE << "Score: " << score << CLR_RESET << " " << (hardMode ? CLR_HARD "[HARD MODE]" : CLR_NORM "[NORMAL MODE]") - << (score > initialHighscore && initialHighscore > 0 ? " NEW BEST! 🥳" : "") + << (score > initialHighscore ? " NEW BEST! 🥳" : "") << " " << std::flush; updateUI = false; } @@ -151,7 +151,7 @@ int main() { tcsetattr(STDIN_FILENO, TCSANOW, &oldt); std::cout << "\n\n" << CLR_SCORE << "Final Score: " << score << CLR_RESET << "\n"; - if (score > initialHighscore && initialHighscore > 0) { + if (score > initialHighscore) { std::cout << "Congratulations! A new personal best!\n"; } std::cout << "Thanks for playing!\n";