Add hitbox to PositionComponent (#618)

* Move out collision detection methods

* Add possibility to define a hull for PositionComponents

* Add example of how to use hull with tapable

* Update contains point comment

* Fix contains point

* Hull should be based on center position

* Remove collision detection parts

* Added tests

* Use percentage of size instead of absolute size

* Separate hull from PositionComponent

* Clarify hull example

* Fix formatting

* Override correct method

* Use mixin for hitbox

* Update changelog

* Rename HasHitbox to Hitbox

* Clarified names

* Center to edge is considered as 1.0

* Fix test

* Add spaces within braces

* Removed extra spaces in the braces

* Add hitbox docs

* Fix link

* Moved point rotation to Vector2 extension

* Render hitbox within extension

* Fix rebase

* Fix rebase

* Fix formatting
This commit is contained in:
Lukas Klingsbo
2021-01-20 23:39:01 +01:00
committed by GitHub
parent b92a22fe27
commit 0593e35766
13 changed files with 259 additions and 55 deletions

View File

@@ -16,6 +16,7 @@ export 'joystick.dart';
export 'src/components/mixins/draggable.dart';
export 'src/components/mixins/has_game_ref.dart';
export 'src/components/mixins/hitbox.dart';
export 'src/components/mixins/single_child_particle.dart';
export 'src/components/mixins/tapable.dart';