free-python-games icon indicating copy to clipboard operation
free-python-games copied to clipboard

[Feature Request] Add high‑score leaderboard and persistent user data support

Open achraf-hh opened this issue 1 month ago • 0 comments

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

  1. A classroom or workshop uses Free Python Games and wants students to compete for high scores.
  2. A user modifies a game and wants to track their best attempts over time.
  3. 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.

achraf-hh avatar Nov 14 '25 16:11 achraf-hh