feat(flame_behaviors): Add ScreenCollisionBehavior#3910
Open
Barba2k2 wants to merge 2 commits intoflame-engine:mainfrom
Open
feat(flame_behaviors): Add ScreenCollisionBehavior#3910Barba2k2 wants to merge 2 commits intoflame-engine:mainfrom
Barba2k2 wants to merge 2 commits intoflame-engine:mainfrom
Conversation
Adds an abstract ScreenCollisionBehavior that pins the Collider generic of CollisionBehavior to ScreenHitbox and exposes screen- specific callbacks (onScreenCollision[Start|End]) that drop the redundant 'other' argument. This removes the boilerplate of writing CollisionBehavior<ScreenHitbox, MyEntity> and clarifies intent at call sites that only care about screen-edge interactions. Closes flame-engine#3750
…ing example class Address review of flame-engine#3910: - Drop the duplicate onScreenCollision*() callback layer. The new abstract class is now a pure type-fix that pins CollisionBehavior's Collider to ScreenHitbox; subclasses override onCollision/onCollisionStart/ onCollisionEnd directly and keep access to the ScreenHitbox (which carries the screen extent — needed e.g. for screen-wrapping logic). - Rename the local class in flame_steering_behaviors_example from ScreenCollisionBehavior to ScreenWrappingBehavior (its actual behaviour) so the example app no longer collides on import with the new public ScreenCollisionBehavior. Migrate it to extend the new abstract base to demonstrate the simplification. - Drop the British 'specialisation' word from the doc to satisfy the cspell dictionary on the spell_checker workflow.
spydon
reviewed
May 3, 2026
Member
spydon
left a comment
There was a problem hiding this comment.
The PR description needs to follow the PR template.
Author
|
@spydon updated the description to follow the PR template — thanks for the heads up. |
Member
It still doesn't unfortunately, it needs to keep all the tags in the original template. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an abstract
ScreenCollisionBehaviortoflame_behaviorsas proposed in #3750.It is a thin type-narrowing of
CollisionBehaviorthat pins theCollidertype parameter toScreenHitbox, so subclasses only need to specify theirParententity.Before
After
The behavior still cooperates with the existing
PropagatingCollisionBehavioron the entity and aScreenHitboxregistered on the game — no wiring changes needed.The
flame_steering_behaviorsexample previously declared a private class also namedScreenCollisionBehavior. It has been renamed toScreenWrappingBehavior(which better describes what it actually does — wrapping entities around screen edges) to avoid the import collision.Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues
Closes #3750