[PR #40] [MERGED] Dev felix #39

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

📋 Pull Request Information

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

Base: devHead: dev_felix


📝 Commits (5)

  • bca7cc0 Feat(Checkpoints) - Add reset_level method to CheckpointDB for resetting checkpoints; implement profiling functionality with cProfile and output to file.
  • f0b2373 Feat(Audio) - Enhance audio handling during video playback; pause main music, play extracted audio on a separate channel, and ensure cleanup of temporary audio files.
  • cbfadb0 Feat(Player) - Add facing direction handling for player; update image rendering based on movement direction and improve joystick control comments.
  • a8f36ce Chore(.gitignore) - Add Python bytecode files to .gitignore; ensure output.prof is ignored.
  • 55bee48 Feat(Level Design) - Update level dimensions and platform properties; enhance enemy and collectible configurations; increase jump and speed boost durations.

📊 Changes

16 files changed (+504 additions, -150 deletions)

View changed files

📝 .gitignore (+4 -1)
📝 assets/map/platform/stone_texture.png (+0 -0)
assets/sound/main_music.mp3 (+0 -0)
📝 map/levels/1.json (+2 -2)
📝 map/levels/2.json (+375 -108)
profiler.py (+9 -0)
📝 src/Database/CheckpointDB.py (+15 -0)
📝 src/Entity/Exit.py (+25 -6)
📝 src/Entity/JumpBoost.py (+2 -2)
📝 src/Entity/Player.py (+45 -15)
📝 src/Entity/SpeedBoost.py (+4 -4)
📝 src/Map/parser.py (+5 -6)
📝 src/constant.py (+6 -0)
📝 src/game.py (+3 -0)
📝 src/handler.py (+9 -6)
temp_audio.mp3 (+0 -0)

📄 Description

This pull request includes various changes to multiple files, enhancing functionality, fixing bugs, and improving code readability and maintainability. The most important changes include adding new methods, updating existing methods, and fixing translation issues.

Enhancements and Bug Fixes:

  • Profiler Integration:

    • Added a profiler to the profiler.py file to help with performance analysis. ([profiler.pyR1-R9](diffhunk://#diff-8fd11f89cf2717e23655193cf3d252fcb1805dfa8da56a18b1914b1066f4a625R1-R9))
  • Database Enhancements:

    • Added a reset_level method to CheckpointDB to reset checkpoints for a specific map. ([src/Database/CheckpointDB.pyR84-R98](diffhunk://#diff-ffd7d15fa6d73583aaaff634c4f75958f1a62b066c3660256b0243ac020ce1a4R84-R98))
  • Gameplay Improvements:

    • Updated the play_video_and_return_to_menu method in Exit.py to handle audio more efficiently by pausing the main music and using a separate channel for temporary audio. ([src/Entity/Exit.pyL78-R111](diffhunk://#diff-14326ced12bc6a36c5aff4235931aac270e908099f2341040be58690d85c2f09L78-R111))
    • Adjusted the boost_duration for JumpBoost and SpeedBoost entities to 10 seconds. ([[1]](diffhunk://#diff-9d3ef4e5a52d071bbfd1fc1cfbda9d12fcd0259c8d0469af9f3c30d7789492d7L18-R19), [[2]](diffhunk://#diff-cdac9e86a94db37076b033962d506030b1e0fc59a8e322a70e0d86cf63c7a9a5L19-R19))
  • Player Entity Enhancements:

    • Added logic to handle player facing direction and improved the animation update method to ensure correct image flipping based on direction. ([[1]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R214-R253), [[2]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R433-R437))
    • Translated and clarified comments in the move and take_damage methods for better readability. ([[1]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2L271-R296), [[2]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2L416-R446))
  • Map and Resource Handling:

    • Modified the create_map_objects method in parser.py to dynamically scale the background image based on map dimensions. ([src/Map/parser.pyR159-R164](diffhunk://#diff-b7d012db5b4cdd07e07d6f78dda95be51706a586fd88f44d2e2d0e9ffa228fafR159-R164))
    • Added logic to load and set the game icon in constant.py. ([src/constant.pyR19-R24](diffhunk://#diff-941b93ca473092cc5313afb6b0966dfc25b01571f7c135a59942f9f0c9514ef4R19-R24))

These changes collectively improve the game's functionality, performance, and code quality.


🔄 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/40 **Author:** [@BreizhHardware](https://github.com/BreizhHardware) **Created:** 4/10/2025 **Status:** ✅ Merged **Merged:** 4/10/2025 **Merged by:** [@ClementHVT](https://github.com/ClementHVT) **Base:** `dev` ← **Head:** `dev_felix` --- ### 📝 Commits (5) - [`bca7cc0`](https://github.com/BreizhHardware/project_sanic/commit/bca7cc0cbc73c664baf3f80420385990f0a7fe87) Feat(Checkpoints) - Add reset_level method to CheckpointDB for resetting checkpoints; implement profiling functionality with cProfile and output to file. - [`f0b2373`](https://github.com/BreizhHardware/project_sanic/commit/f0b237326f085723fb7d78a8acddd419a17dd496) Feat(Audio) - Enhance audio handling during video playback; pause main music, play extracted audio on a separate channel, and ensure cleanup of temporary audio files. - [`cbfadb0`](https://github.com/BreizhHardware/project_sanic/commit/cbfadb0bbb1e4dc26dc324d2e8729e7ad1a38cc7) Feat(Player) - Add facing direction handling for player; update image rendering based on movement direction and improve joystick control comments. - [`a8f36ce`](https://github.com/BreizhHardware/project_sanic/commit/a8f36ce8e1adc4d6d2d47968c34e69db6a5baef1) Chore(.gitignore) - Add Python bytecode files to .gitignore; ensure output.prof is ignored. - [`55bee48`](https://github.com/BreizhHardware/project_sanic/commit/55bee48093b8d3c9f85bd2fc5c7441ef3e45358d) Feat(Level Design) - Update level dimensions and platform properties; enhance enemy and collectible configurations; increase jump and speed boost durations. ### 📊 Changes **16 files changed** (+504 additions, -150 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+4 -1) 📝 `assets/map/platform/stone_texture.png` (+0 -0) ➕ `assets/sound/main_music.mp3` (+0 -0) 📝 `map/levels/1.json` (+2 -2) 📝 `map/levels/2.json` (+375 -108) ➕ `profiler.py` (+9 -0) 📝 `src/Database/CheckpointDB.py` (+15 -0) 📝 `src/Entity/Exit.py` (+25 -6) 📝 `src/Entity/JumpBoost.py` (+2 -2) 📝 `src/Entity/Player.py` (+45 -15) 📝 `src/Entity/SpeedBoost.py` (+4 -4) 📝 `src/Map/parser.py` (+5 -6) 📝 `src/constant.py` (+6 -0) 📝 `src/game.py` (+3 -0) 📝 `src/handler.py` (+9 -6) ➖ `temp_audio.mp3` (+0 -0) </details> ### 📄 Description This pull request includes various changes to multiple files, enhancing functionality, fixing bugs, and improving code readability and maintainability. The most important changes include adding new methods, updating existing methods, and fixing translation issues. ### Enhancements and Bug Fixes: * **Profiler Integration:** * Added a profiler to the `profiler.py` file to help with performance analysis. (`[profiler.pyR1-R9](diffhunk://#diff-8fd11f89cf2717e23655193cf3d252fcb1805dfa8da56a18b1914b1066f4a625R1-R9)`) * **Database Enhancements:** * Added a `reset_level` method to `CheckpointDB` to reset checkpoints for a specific map. (`[src/Database/CheckpointDB.pyR84-R98](diffhunk://#diff-ffd7d15fa6d73583aaaff634c4f75958f1a62b066c3660256b0243ac020ce1a4R84-R98)`) * **Gameplay Improvements:** * Updated the `play_video_and_return_to_menu` method in `Exit.py` to handle audio more efficiently by pausing the main music and using a separate channel for temporary audio. (`[src/Entity/Exit.pyL78-R111](diffhunk://#diff-14326ced12bc6a36c5aff4235931aac270e908099f2341040be58690d85c2f09L78-R111)`) * Adjusted the `boost_duration` for `JumpBoost` and `SpeedBoost` entities to 10 seconds. (`[[1]](diffhunk://#diff-9d3ef4e5a52d071bbfd1fc1cfbda9d12fcd0259c8d0469af9f3c30d7789492d7L18-R19)`, `[[2]](diffhunk://#diff-cdac9e86a94db37076b033962d506030b1e0fc59a8e322a70e0d86cf63c7a9a5L19-R19)`) * **Player Entity Enhancements:** * Added logic to handle player facing direction and improved the animation update method to ensure correct image flipping based on direction. (`[[1]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R214-R253)`, `[[2]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R433-R437)`) * Translated and clarified comments in the `move` and `take_damage` methods for better readability. (`[[1]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2L271-R296)`, `[[2]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2L416-R446)`) * **Map and Resource Handling:** * Modified the `create_map_objects` method in `parser.py` to dynamically scale the background image based on map dimensions. (`[src/Map/parser.pyR159-R164](diffhunk://#diff-b7d012db5b4cdd07e07d6f78dda95be51706a586fd88f44d2e2d0e9ffa228fafR159-R164)`) * Added logic to load and set the game icon in `constant.py`. (`[src/constant.pyR19-R24](diffhunk://#diff-941b93ca473092cc5313afb6b0966dfc25b01571f7c135a59942f9f0c9514ef4R19-R24)`) These changes collectively improve the game's functionality, performance, and code quality. --- <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:28 +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#39
No description provided.