[PR #32] [MERGED] Feat(Game Logic) - Integrate speedrun timer functionality; add Speedr… #32

Closed
opened 2026-05-06 12:17:27 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/BreizhHardware/project_sanic/pull/32
Author: @BreizhHardware
Created: 4/9/2025
Status: Merged
Merged: 4/9/2025
Merged by: @ClementHVT

Base: devHead: dev_felix


📝 Commits (1)

  • 60aa7f6 Feat(Game Logic) - Integrate speedrun timer functionality; add SpeedrunTimer class, modify game state management to include timer, and update leaderboard to display best times.

📊 Changes

4 files changed (+283 additions, -41 deletions)

View changed files

📝 src/Map/Infinite/InfiniteMapGenerator.py (+9 -1)
src/Map/Speedrun/SpeedrunTimer.py (+105 -0)
📝 src/Menu/Leaderboard.py (+116 -26)
📝 src/handler.py (+53 -14)

📄 Description

This pull request introduces several new features and improvements, particularly focusing on the speedrun functionality and leaderboard enhancements. The most important changes include the addition of a SpeedrunTimer class, modifications to handle speedrun times, and updates to the leaderboard to display level-specific scores.

Speedrun Functionality:

Leaderboard Enhancements:

  • src/Menu/Leaderboard.py: Updated the leaderboard to display scores for individual levels, including fetching and formatting scores from the database. Added new tabs for each level and improved the display of scores. [1] [2]

Platform Generation:


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BreizhHardware/project_sanic/pull/32 **Author:** [@BreizhHardware](https://github.com/BreizhHardware) **Created:** 4/9/2025 **Status:** ✅ Merged **Merged:** 4/9/2025 **Merged by:** [@ClementHVT](https://github.com/ClementHVT) **Base:** `dev` ← **Head:** `dev_felix` --- ### 📝 Commits (1) - [`60aa7f6`](https://github.com/BreizhHardware/project_sanic/commit/60aa7f6e11acbd6c142c879279025ecd4ab40180) Feat(Game Logic) - Integrate speedrun timer functionality; add SpeedrunTimer class, modify game state management to include timer, and update leaderboard to display best times. ### 📊 Changes **4 files changed** (+283 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `src/Map/Infinite/InfiniteMapGenerator.py` (+9 -1) ➕ `src/Map/Speedrun/SpeedrunTimer.py` (+105 -0) 📝 `src/Menu/Leaderboard.py` (+116 -26) 📝 `src/handler.py` (+53 -14) </details> ### 📄 Description This pull request introduces several new features and improvements, particularly focusing on the speedrun functionality and leaderboard enhancements. The most important changes include the addition of a `SpeedrunTimer` class, modifications to handle speedrun times, and updates to the leaderboard to display level-specific scores. ### Speedrun Functionality: * [`src/Map/Speedrun/SpeedrunTimer.py`](diffhunk://#diff-718f6c7e10b0900d257b42d2e648b7997ff92225a6106964aa653f781ab33242R1-R105): Introduced a new `SpeedrunTimer` class to manage speedrun times, including starting, stopping, updating, and saving times to a database. * [`src/handler.py`](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R24): Integrated `SpeedrunTimer` into the game flow, including starting the timer when a level starts, updating the timer during gameplay, and saving the time when a level is completed. [[1]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R24) [[2]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R211-R215) [[3]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R233) [[4]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R253) [[5]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R271) [[6]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R421) [[7]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L439-R449) [[8]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L448-R474) [[9]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L481-R496) [[10]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R515-R517) [[11]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L581-R604) [[12]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L649-R669) [[13]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R749-R751) [[14]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R769-R794) ### Leaderboard Enhancements: * [`src/Menu/Leaderboard.py`](diffhunk://#diff-97e03c05f742e916020d440357774bf13b8c91b1e267f081d7035d0057a246a4R2-R101): Updated the leaderboard to display scores for individual levels, including fetching and formatting scores from the database. Added new tabs for each level and improved the display of scores. [[1]](diffhunk://#diff-97e03c05f742e916020d440357774bf13b8c91b1e267f081d7035d0057a246a4R2-R101) [[2]](diffhunk://#diff-97e03c05f742e916020d440357774bf13b8c91b1e267f081d7035d0057a246a4L38-R148) ### Platform Generation: * [`src/Map/Infinite/InfiniteMapGenerator.py`](diffhunk://#diff-4b12e16775d22dea8d6bdbda74643886abf25c6f838187bdd5980ced5334b684R73-R86): Improved platform generation logic to ensure platforms are placed within a reasonable jump height, enhancing gameplay experience. [[1]](diffhunk://#diff-4b12e16775d22dea8d6bdbda74643886abf25c6f838187bdd5980ced5334b684R73-R86) [[2]](diffhunk://#diff-4b12e16775d22dea8d6bdbda74643886abf25c6f838187bdd5980ced5334b684R121) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:17:27 +02:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BreizhHardware/project_sanic#32
No description provided.