[PR #41] [MERGED] Feat(FloatingText) - Implement FloatingText class for displaying temp… #42

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

📋 Pull Request Information

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

Base: devHead: dev_felix


📝 Commits (6)

  • 1478360 Feat(FloatingText) - Implement FloatingText class for displaying temporary messages; update player to manage and draw floating texts on screen; enhance error messages in constant.py and improve code readability.
  • bf17cc7 Fix(Enemy) - Correct indentation for player.add_projectiles() call to ensure proper execution flow in event handling.
  • 692504d Refactor(Player) - Remove draw_floating_text method and its call in update; streamline floating text management for improved performance.
  • c59fea3 Fix(Handler) - Correct parallax effect calculations for background positioning; ensure seamless background movement in all directions.
  • 9451e79 Feat(Cinematic) - Add Cinematic class for level 1 storytelling; integrate cinematic playback into map loading process and remove redundant cinematic method from MapParser.
  • ed86161 Feat(Cinematic) - Update play_cinematic method to accept level name; ensure cinematic plays only for Level 1 and improve event handling during playback.

📊 Changes

8 files changed (+162 additions, -70 deletions)

View changed files

📝 src/Database/CheckpointDB.py (+1 -1)
📝 src/Entity/Enemy.py (+0 -1)
src/Entity/FloatingText.py (+44 -0)
📝 src/Entity/Player.py (+9 -1)
src/Map/cinematic.py (+89 -0)
📝 src/Map/parser.py (+3 -60)
📝 src/constant.py (+2 -2)
📝 src/handler.py (+14 -5)

📄 Description

This pull request introduces a new feature for displaying floating text above the player when certain actions occur, along with some minor code cleanups and improvements.

New Feature: Floating Text

  • src/Entity/FloatingText.py: Added a new class FloatingText to handle the creation, updating, and drawing of floating text above the player.
  • src/Entity/Player.py: Integrated the FloatingText class into the player entity, including initializing a list of floating texts, updating and drawing them, and adding floating text when the player gains projectiles. [1] [2] [3] [4] [5]
  • src/handler.py: Updated the game handler to draw floating texts during the game loop.

Code Cleanups and Improvements


🔄 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/41 **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 (6) - [`1478360`](https://github.com/BreizhHardware/project_sanic/commit/14783601e47d95939f6a84f9b30783655b740c3f) Feat(FloatingText) - Implement FloatingText class for displaying temporary messages; update player to manage and draw floating texts on screen; enhance error messages in constant.py and improve code readability. - [`bf17cc7`](https://github.com/BreizhHardware/project_sanic/commit/bf17cc7891de278771fc8b52592e0a8466c0c69b) Fix(Enemy) - Correct indentation for player.add_projectiles() call to ensure proper execution flow in event handling. - [`692504d`](https://github.com/BreizhHardware/project_sanic/commit/692504d4ad85ecbe6b145ce7b43c3e726986b3d9) Refactor(Player) - Remove draw_floating_text method and its call in update; streamline floating text management for improved performance. - [`c59fea3`](https://github.com/BreizhHardware/project_sanic/commit/c59fea37c9c13a23d0146280b0eeee23d7d51ac2) Fix(Handler) - Correct parallax effect calculations for background positioning; ensure seamless background movement in all directions. - [`9451e79`](https://github.com/BreizhHardware/project_sanic/commit/9451e7961f44505fbaaf3a0f97e2fb0500c520f1) Feat(Cinematic) - Add Cinematic class for level 1 storytelling; integrate cinematic playback into map loading process and remove redundant cinematic method from MapParser. - [`ed86161`](https://github.com/BreizhHardware/project_sanic/commit/ed86161be97e3f5bb4b0d7fdae89479b4edfb0ef) Feat(Cinematic) - Update play_cinematic method to accept level name; ensure cinematic plays only for Level 1 and improve event handling during playback. ### 📊 Changes **8 files changed** (+162 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `src/Database/CheckpointDB.py` (+1 -1) 📝 `src/Entity/Enemy.py` (+0 -1) ➕ `src/Entity/FloatingText.py` (+44 -0) 📝 `src/Entity/Player.py` (+9 -1) ➕ `src/Map/cinematic.py` (+89 -0) 📝 `src/Map/parser.py` (+3 -60) 📝 `src/constant.py` (+2 -2) 📝 `src/handler.py` (+14 -5) </details> ### 📄 Description This pull request introduces a new feature for displaying floating text above the player when certain actions occur, along with some minor code cleanups and improvements. ### New Feature: Floating Text * [`src/Entity/FloatingText.py`](diffhunk://#diff-c36ea2b938b7925beffbdd91b941dd3e10dad33d5934a1f001cc3b7f1a08acc2R1-R44): Added a new class `FloatingText` to handle the creation, updating, and drawing of floating text above the player. * [`src/Entity/Player.py`](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R7-R8): Integrated the `FloatingText` class into the player entity, including initializing a list of floating texts, updating and drawing them, and adding floating text when the player gains projectiles. [[1]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R7-R8) [[2]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R68) [[3]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R441-R443) [[4]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2L686-R696) [[5]](diffhunk://#diff-c0effc013092db6988c4774ca8aa3c2ca0c1b1890ffeed5401b98d17d217acc2R730-R734) * [`src/handler.py`](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188R489-R491): Updated the game handler to draw floating texts during the game loop. ### Code Cleanups and Improvements * [`src/Entity/Enemy.py`](diffhunk://#diff-dad158efd8851dc4420df9210b13522c72a457342617642e1ea4f84814ad07fbL2): Removed an unused import statement for `os`. * [`src/constant.py`](diffhunk://#diff-941b93ca473092cc5313afb6b0966dfc25b01571f7c135a59942f9f0c9514ef4L23-R31): Fixed a typo in an error message and enabled vsync for the display surface. * [`src/handler.py`](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L614-R617): Fixed minor formatting issues and added a missing comma in function calls. [[1]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L614-R617) [[2]](diffhunk://#diff-87e072956b3498cea1c9c03f2d500bf062c0d59e2f74fba337a39118c7ea9188L901-R904) --- <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:29 +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#42
No description provided.