Conversation
…s for defining physical properties
* pong * blasters * collector
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bedcdacbbf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ($this->getTransform()->getPosition() !== $this->previousPlayerPosition) { | ||
| $this->totalStepsTaken++; | ||
| $this->previousPlayerPosition = $this->getTransform()->getPosition(); |
There was a problem hiding this comment.
Track steps from player coordinates instead of manager transform
onUpdate() compares LevelManager's own transform position to previousPlayerPosition, but this component is attached to the level-manager object (which does not move), so the step counter never reflects player movement. In the Collector scene this keeps the "Steps" label at zero even while the player moves around.
Useful? React with 👍 / 👎.
| $activeScene->add($this->collectedLabel); | ||
| $activeScene->add($this->stepsLabel); |
There was a problem hiding this comment.
Avoid adding duplicate HUD labels every scene restart
These labels are created and added inside onStart(), which runs each time the scene starts; because SceneManager reuses scene instances, re-entering/restarting the Collector level appends another pair of labels each time. This causes duplicated HUD text and unbounded UI element growth across restarts.
Useful? React with 👍 / 👎.
This pull request introduces several improvements and updates across the codebase and documentation, focusing on collision detection, UI label handling, and PHP version compatibility. The most significant changes are the addition of a comprehensive collision detection guide, refactoring of label management in the Collector example, and updating the PHP version requirement.
Documentation Enhancements
Collision Detection Guide(docs/Collision.md) explaining collision workflows, strategies, and practical usage in Sendama. Linked this guide from both theREADME.mdanddocs/DOCS.mdfor easier access. [1] [2] [3]Collector Example Refactoring
Level01.php) to theLevelManagerclass, making UI updates more robust and encapsulated. Labels are now updated automatically as the player moves and collects items. [1] [2] [3] [4] [5]LevelManagerby tracking the player's position and incrementing steps only when it changes.Collision Handling Improvements
CollectableControllersets its collider as a trigger only if not already present, improving reliability of collectable item behavior.Core and Example Updates
Texture2DtoTexturein both Collector and Blasters examples for consistency with engine changes. [1] [2] [3] [4] [5]SettingsSceneto use screen dimensions fromSceneManagersettings, improving adaptability to different screen sizes. [1] [2]Compatibility and Configuration
composer.jsonfrom^8.3to^8.4.Other Notable Changes
sendama.jsonfor the Collector example, allowing for customizable screen width and height.setMenuTitleinstead ofsetTitlefor the title scene.