Commit Graph

25 Commits

Author SHA1 Message Date
Luan Nico
9c38c9bd04 New linter rules (#676) 2021-02-23 12:16:23 -05:00
Lukas Klingsbo
bde4585fa0 Collision detection (#633)
* 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

* Use percentage of size instead of absolute size

* Separate hull from PositionComponent

* Clarify hull example

* Fix formatting

* Change to relative import

* Use mixin for hitbox

* Update changelog

* Rename HasHitbox to Hitbox

* Clarified names

* Add spaces within braces

* Removed extra spaces in the braces

* Moved point rotation to Vector2 extension

* Render hitbox within extension

* Added collision detection

* Add tests

* Separate classes into files

* Fix formatting

* Move geometry files into geometry directory

* Use relative import for mixin

* Begin intersections between different shapes

* Add shape class

* Align with rebase

* Fix CHANGELOG

* Fix children positioning

* New polygon intersection algorithm

* No anchor for shape in PoC

* Remove unused imports

* Smarter bounding rectangle comparisons

* Formatting

* Add Circle to Circle collision

* Circle-polygon intersections

* Explanation of circle-circle intersections

* Properly render circle circle collisions

* Fix formatting

* Better example

* Update docs for collision detection

* Fix formatting

* Add polygon definition example

* Update documentation about the shapes

* Moved premature rc6 changelog line

* Added a cache system for shape calculations

* Fix formatting

* Fix formatting

* Fix imports

* Add collidable polygon to example

* Use anchorPosition for PositionComponent containsPoint

* Fix angle problem for Rectangle

* collisionCallback -> onCollision

* Fixed Erick's comments

* Improve collision detection example

* Fix #662, zero size doesn't contain any points

* Fix formatting

* Can't contain point if x or y is 0

* Fix formatting

* Fix test

* Remove unnecessary collidable example part

* Align with Draggable overhaul

* Updated collision detection docs

* Fix PR comments

* Have more sensible Circle constructor

* Clarify shape fields

* Need ensureInitialized

* Update docs to conform with switched constructors

* Fix new definitions

* Fix formatting

* Update documentation

* Fix formatting

* Fix formatting

* Exclude metrics check for test files

* Add another simpler example of collision detection

* Updated according to comments

* Fix comments

* Fix more comments

* Fix more comments

* Fix relative import

* Fix comments

* Moved export of geometry

* Fix comments

* Remove unused import

* Fix assert for shape.component

* Fix comments

* Expect instead of assert in test
2021-02-22 00:44:11 +01:00
Erick
0d4df1acc2 Preventing errors caused by the premature use of size property on game (#659) 2021-02-15 17:07:58 -05:00
Lukas Klingsbo
5d953c8b24 Fix gesture detection on children (#636)
* Fix gesture detection on children

* Remove unused imports

* positionParent should be private

* Fixed comment

* Moved parent to BaseComponent

* Fix formatting
2021-01-20 13:44:06 +01:00
Renan
ccee9a466b Move files to src and comply with the dart package layout convention (#621)
* 👌 Use `Offset` type directly in `JoystickAction.update` calculations (#631)

* Move files to src and comply with the dart package layout convention

* Fixing widgets example

Co-authored-by: Serge Matveenko <lig@countzero.co>
Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>
2021-01-20 09:05:43 -03:00
Lukas Klingsbo
9921617fd5 Add test for removal of component children (#605)
* Add test for removal of component children

* Fix formatting
2021-01-03 23:43:39 +01:00
Lukas Klingsbo
18d04c13c0 Remove Resizable mixin (#589)
* Remove Resizable mixin

* Update examples and changelog

* Fixed formatting

* Remove unused import
2020-12-22 15:55:29 +01:00
Erick Zanardo
317bc7d800 Fixing tests 2020-12-12 16:01:54 -03:00
Erick Zanardo
8f32df490d Formating 2020-12-12 15:53:33 -03:00
Erick Zanardo
c020383887 Linting 2020-12-12 18:28:00 +00:00
Erick Zanardo
11628b1edb Adding tests and handling composed components 2020-12-12 18:28:00 +00:00
Erick Zanardo
4c9b89b849 Fixing tests 2020-12-12 18:26:52 +00:00
Lukas Klingsbo
f917920f45 Fix children update and rendering (#565)
* Fix children update and rendering

* Add changelog

* Fix formatting

* Add note about addChildren and remove assert

* Re-add child.rendered test

* Add MockCanvas and use it for composed test
2020-12-11 13:14:36 +01:00
Lukas Klingsbo
1c36b6ebf1 Use relative import 2020-12-09 10:10:12 +00:00
Lukas Klingsbo
8665172ed9 Take angle into account for taps 2020-12-09 10:10:11 +00:00
Lukas Klingsbo
7d9732174a Fix ComposedComponentTest 2020-11-15 01:18:51 +01:00
Renan
47aba31eff Fix resizable conflict (#483) 2020-10-06 14:13:31 +01:00
Lukas Klingsbo
7bc9c9a3a7 Create extensions for Size and Offset 2020-09-21 19:50:54 +02:00
Lukas Klingsbo
540e021d8b Rename vector2_extension to vector2 2020-09-21 12:17:21 +02:00
Lukas Klingsbo
50f8ffce3b Vector2 extension 2020-09-20 17:30:58 +02:00
Lukas Klingsbo
c90f636136 Use delegate Vector2F class instead of Vector2 2020-09-18 00:00:13 +02:00
Lukas Klingsbo
c95c93b3cd VectorUtil -> Vector2Operations 2020-09-12 16:43:29 +02:00
Lukas Klingsbo
5edd5f0fbd Move from Position to Vector2 2020-09-10 01:16:25 +02:00
Luan Nico
997f36edc4 Part 3: Great Composed Component Refactor 2020-08-08 19:49:10 -04:00
Luan Nico
e9db8293e3 fix tests 2020-08-03 13:36:16 -04:00