free-python-games
free-python-games copied to clipboard
[Feature Request] Add high‑score leaderboard and persistent user data support
Describe the feature
It would greatly enhance the Free Python Games collection if each game supported a high‑score leaderboard stored persistently (e.g., in a file or lightweight DB) and optionally tracked simple user profiles. This would provide replay value and encourage experimentation.
Expected behavior
- On game launch, user can optionally enter a username.
- After game over, the score is saved and compared to previous scores (per‑game leaderboard).
- A “View Leaderboard” option is available in each game’s menu.
- Scores and usernames persist across sessions (e.g., via JSON or SQLite).
- Simple cleanup: e.g., top 10 scores, timestamps of when they were achieved.
Use cases
- A classroom or workshop uses Free Python Games and wants students to compete for high scores.
- A user modifies a game and wants to track their best attempts over time.
- Contributors adding new games can reuse the leaderboard module across games.
Additional context
Currently each game appears to be self‑contained and stateless (or reset each session). Adding a small shared module for persistent leaderboard support would increase engagement and broaden possibilities for extensions.