Commit Graph

48 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
Luan Nico
9be4031706 Add assert to make Draggables are used properly (#671) 2021-02-19 14:47:37 -05:00
pedia
e712d423dd fix SpriteAnimationComponent.shouldRemove use Component.shouldRemove (#666) 2021-02-16 23:20:11 -03: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
0593e35766 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
2021-01-20 23:39:01 +01: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
add2a4fdc8 Add test for not overlapping with angle 2020-12-09 10:10:12 +00: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
Luan Nico
00d363f531 Rename resize method on the Game to onResize 2020-10-29 18:59:38 -04:00
Renan
47aba31eff Fix resizable conflict (#483) 2020-10-06 14:13:31 +01:00
Lukas Klingsbo
697affce8c Update comments and naming of positional methods 2020-10-01 22:38:30 +02:00
Lukas Klingsbo
28c535deb1 Add tests for anchor position 2020-09-30 21:33:52 +02:00
Lukas Klingsbo
f97f20ab73 Vector2 for position and size on PositionComponent 2020-09-30 19:12:52 +02:00
Lukas Klingsbo
d39701ac50 Add isRelative to some effects 2020-09-23 16:06:40 +02:00
Lukas Klingsbo
7bc9c9a3a7 Create extensions for Size and Offset 2020-09-21 19:50:54 +02:00
Lukas Klingsbo
385e60e554 setByPosition -> setPosition 2020-09-21 13:17:56 +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
164af17881 Remove unused imports 2020-09-10 01:24:07 +02:00
Lukas Klingsbo
5edd5f0fbd Move from Position to Vector2 2020-09-10 01:16:25 +02:00
Luan Nico
201295f767 Merge pull request #440 from flame-engine/luan.composed-p3
[v1] Part 3: Great Composed Component Refactor
2020-08-18 23:43:54 -04:00
Erick Zanardo
7530e24c66 Merge branch 'develop' into v1.0.0 2020-08-11 22:07:54 -03:00
Luan Nico
997f36edc4 Part 3: Great Composed Component Refactor 2020-08-08 19:49:10 -04:00
Erick
dfbb0d2ffe Merge branch 'v1.0.0' into spydon.box2d-refactor 2020-08-05 20:19:57 -03:00
Erick Zanardo
a7ef691756 Moving tiled support to a separate package 2020-08-04 17:58:04 -03:00
Luan Nico
e9db8293e3 fix tests 2020-08-03 13:36:16 -04:00
Lukas Klingsbo
34b2b5c256 Removed viewport test 2020-07-31 21:20:39 +02:00
Luan Nico
f105abfed8 Fix tests 2020-06-28 13:04:06 -04:00
Luan Nico
e129e7f8c1 fixing warnings and nits on the tests 2019-10-14 17:15:56 -04:00
Renan Araujo
b1a3d222a9 use final 2019-03-22 13:35:46 -03:00
Luan Nico
9c69937b5b Fixes build (tests), adding ditance method to position, fix linting (formating, quotes), removed uneeded new keywords everywhere 2019-03-10 15:17:53 -03:00
Luan Nico
bd51364400 formating and fixing warnings 2019-02-09 12:06:59 -02:00
Luan Nico
45455f60f0 Adding SimpleGame, EmbeddedGameWidget and animationAsWidget to allow for easy integration of flame with non-game flutter apps, plus docs improved, minor fixes 2019-01-24 21:31:49 -02:00
feroult
b1f1011053 tiled 2019-01-01 20:15:44 -02:00