Skip to content

Enhance physics materials, collision detection, and example projects#45

Merged
amasiye merged 14 commits into
mainfrom
develop
Mar 11, 2026
Merged

Enhance physics materials, collision detection, and example projects#45
amasiye merged 14 commits into
mainfrom
develop

Conversation

@amasiye

@amasiye amasiye commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

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

  • Added a new Collision Detection Guide (docs/Collision.md) explaining collision workflows, strategies, and practical usage in Sendama. Linked this guide from both the README.md and docs/DOCS.md for easier access. [1] [2] [3]

Collector Example Refactoring

  • Moved the creation and management of score and steps labels from the scene setup (Level01.php) to the LevelManager class, making UI updates more robust and encapsulated. Labels are now updated automatically as the player moves and collects items. [1] [2] [3] [4] [5]
  • Improved step counting logic in LevelManager by tracking the player's position and incrementing steps only when it changes.

Collision Handling Improvements

  • Ensured that the CollectableController sets its collider as a trigger only if not already present, improving reliability of collectable item behavior.

Core and Example Updates

  • Updated all references from Texture2D to Texture in both Collector and Blasters examples for consistency with engine changes. [1] [2] [3] [4] [5]
  • Adjusted menu positioning in SettingsScene to use screen dimensions from SceneManager settings, improving adaptability to different screen sizes. [1] [2]

Compatibility and Configuration

  • Updated the minimum required PHP version in composer.json from ^8.3 to ^8.4.
  • Added empty input configuration and preferences files for both Collector and Blasters examples to support future customization. [1] [2]

Other Notable Changes

  • Enhanced player screen settings in sendama.json for the Collector example, allowing for customizable screen width and height.
  • Minor fix in Collector's bootstrap to use setMenuTitle instead of setTitle for the title scene.

@amasiye amasiye merged commit f7a42d2 into main Mar 11, 2026
0 of 2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +82 to +84
if ($this->getTransform()->getPosition() !== $this->previousPlayerPosition) {
$this->totalStepsTaken++;
$this->previousPlayerPosition = $this->getTransform()->getPosition();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +63 to +64
$activeScene->add($this->collectedLabel);
$activeScene->add($this->stepsLabel);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant