Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add missing hitbox parameters #2070

Merged
merged 4 commits into from
Oct 16, 2022

Conversation

mattmyne
Copy link
Contributor

Description

This PR adds the position parameter to PolygonHitbox and isSolid parameters to all hitbox classes' .relative named constructors.

Also returns PolygonComponent's internal topLeft parameter to private _topLeft as no longer required outside of the class file.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Add missing position to PolygonHitbox and isSolid to all relative hitbox named constructors.

Restored PolygonComponent's internal topLeft parameter to private _topLeft as no longer required outside of class file.
@mattmyne
Copy link
Contributor Author

Adding the position parameter to PolygonHitbox also means the same vertices list used for (an optional) parent PolygonComponent can be reused in the PolygonHitbox constructor with position: Vector2.zero(). Previously position would be fixed at null and the hitbox would be offset by topLeft, with no way of correcting except to clone and modify the original vertices list.

@spydon spydon requested a review from a team October 15, 2022 00:20
@spydon spydon enabled auto-merge (squash) October 16, 2022 17:59
@spydon spydon merged commit 8aacb55 into flame-engine:main Oct 16, 2022
@mattmyne mattmyne deleted the hitbox-add-missing-params branch October 16, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants