From 5b131d5d375be1cf9c05e2e4607c6f4bd53ad885 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 17:17:58 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Enhanced=20achievemen?= =?UTF-8?q?t=20feedback=20and=20real-time=20high-score=20tracking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update the live gameplay UI to display the high score in real-time. - Colorize the "GO!" transition message with Bold Green for better visual feedback. - Modify the achievement logic to include first-time players (where initial high score is 0). - Update the Palette journal with learnings on inclusive achievement feedback. Co-authored-by: aidasofialily-cmd <247843425+aidasofialily-cmd@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ src/main.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index c4e3778..01506c8 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-05-24 - Inclusive Achievement Feedback +**Learning:** Users experience the highest level of engagement during their initial interaction. Suppressing "New Personal Best" or congratulations messages for first-time players (e.g., by checking `initialHighscore > 0`) misses a critical opportunity for delight. +**Action:** Ensure achievement celebrations and personal best indicators are inclusive of first-time players by comparing against the initial baseline, even if that baseline is zero. diff --git a/src/main.cpp b/src/main.cpp index e72f1da..695a994 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -108,7 +108,7 @@ int main() { } } } - std::cout << "\rGO! \n" << std::flush; + std::cout << "\r" << CLR_NORM << "GO! " << CLR_RESET << "\n" << std::flush; std::this_thread::sleep_for(std::chrono::milliseconds(200)); tcflush(STDIN_FILENO, TCIFLUSH); @@ -137,9 +137,10 @@ int main() { } if (updateUI) { - std::cout << "\r" << CLR_SCORE << "Score: " << score << CLR_RESET << " " + std::cout << "\r" << CLR_SCORE << "Score: " << score << CLR_RESET + << " | High: " << (score > highscore ? score : highscore) << " " << (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 +152,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";