Skip to content

Fix: prevent Snake game from re-rendering and add score tracking - #150

Open
KORandi wants to merge 1 commit into
ThePrimeagen:masterfrom
KORandi:fix/snake-game-round-and-score
Open

Fix: prevent Snake game from re-rendering and add score tracking#150
KORandi wants to merge 1 commit into
ThePrimeagen:masterfrom
KORandi:fix/snake-game-round-and-score

Conversation

@KORandi

@KORandi KORandi commented Jan 13, 2026

Copy link
Copy Markdown

Add standalone game support configuration + showing score tracking for Snake game at the end screen

Previous Behaviour

  • Snake game was treated like regular games with multiple rounds
  • Displayed "Round 1/10" instead of "Round 1/1"
  • After finishing game, jumped to "Round 10/10" and showed menu in background
  • Game restarted automatically and user had to either finish it again or use mouse to click terminal (at least on macOS)
  • Score was not displayed at end of game
  • Statistics were incorrectly calculated for Snake

Expected Behaviour

  • Standalone games (currently only Snake) display "Round 1/1" during gameplay
  • When game ends, display "Game finished!" and final score
  • Game does not restart automatically
  • Menu appears properly after game completion
  • Score is properly logged in statistics
  • No round statistics should be shown for standalone games

Previously

End screen re-renders Snake game

previous-end-scren

Showing 1/10 rounds

previous-run-game-showing-rounds

After the fix

End screen now correctly shows score

fixed-end-screen

During the run it shows 1/1 rounds

fixed-run

- Add isStandalone flag for games that don't use round system
- Display "Game finished!" and score instead of round statistics
- Fix issue where Snake would restart after completing and show menu in background
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant