Commit Graph

823 Commits

Author SHA1 Message Date
Lukas Klingsbo
cb15de7e0f Fix order of parent -> children rendering (#684)
* Fix order of parent -> children rendering

* Fix import

* Move debug rendering

* Call renderTree on children too

* Component to have renderTree
2021-02-24 20:17:28 +01:00
Lukas Klingsbo
9ab9003c85 Revert "Fix children render order (#682)" (#683)
This reverts commit 5dea1ae54a.
2021-02-24 12:42:04 +01:00
Lukas Klingsbo
5dea1ae54a Fix children render order (#682)
* Fix children render order

* Add changelog
2021-02-23 23:54:19 +01:00
Luan Nico
062b73d5f5 More followups from #667 : Unifying constructor logic + small improvements and docs (#681) 2021-02-23 17:38:19 -05:00
Luan Nico
9c38c9bd04 New linter rules (#676) 2021-02-23 12:16:23 -05:00
Luan Nico
6329a12150 Followups to #667 (#680) 2021-02-23 11:49:11 -05:00
Lukas Klingsbo
cdca4b6858 Standardize on dt in update methods (#679)
* Standardize on dt in update methods

* Update changelog entry

* Update CHANGELOG.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-02-23 17:36:05 +01:00
pedia
9735cf5e08 Improve default constructor for positioned components (#667) 2021-02-23 11:27:17 -05:00
Jochum van der Ploeg
ec09ce0ce6 Added toImage method (#661) 2021-02-22 18:34:21 -05:00
Lukas Klingsbo
4e5b75eafb Enable user-defined Anchors (#675)
* Enable user-defined Anchors

* Fix formatting

* get toVector2 -> toVector2()
2021-02-22 22:09:41 +01: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
65584bdc91 Make the anchor class look more like an enum (#669) 2021-02-19 14:56:06 -05:00
Luan Nico
9be4031706 Add assert to make Draggables are used properly (#671) 2021-02-19 14:47:37 -05:00
Erick
19ff80a0eb Adds checking for trailling commas on the project (#670)
* Testing a new linter option for trailling commas

* Checking trailling commas on linter
2021-02-18 11:31:45 -03: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
Luan Nico
12cafb1da3 Draggables Overhaul (#660) 2021-02-15 14:06:35 -05:00
Jochum van der Ploeg
ac40b2c787 Added Color and Image extensions (#653)
Co-authored-by: Erick <erickzanardoo@gmail.com>
2021-02-09 20:25:55 -03:00
Erick
d98a1ede44 Improving Parallax APIs regarding handling its size and the use outside FCS (#651)
* Improving Parallax APIs regarding handling its size and the use outside FCS

* Formatting

* Fixing flutter format vs flutter analyze crazy conflicts

* Some suggestions

* Removing unecessary line

* Luan suggestions

* Luan suggestion

* Lukas suggestions

* updating comment
2021-02-04 12:26:37 -03:00
Erick
4db3c0e401 Enabling direct import of Sprite and SpriteAnimation (#652)
* Enabling direct import of Sprite and SpriteAnimation

* Renan follow up

* Fixing spritesheet exmaple

Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>
2021-02-03 14:20:39 -03:00
Jochum van der Ploeg
64a474ff38 Adding rotation to the ImageComposition class (#646)
* Added rotation to the ImageComposition class

* Renamed compositon to image_composition
2021-02-03 17:15:45 +01:00
Erick
976e8daf35 Adapting ParallaxComponent constructors to other components (#642)
* Adapating ParallaxComponent constructors to other components

* Removing wrongly commited folder

* Update doc/components.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* Update doc/components.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-01-27 09:13:56 -03:00
Erick
ab18edb00f Adapting SpriteBatchComponent constructors to other components (#643) 2021-01-26 22:12:58 -03:00
Erick
0c3d8f1bf1 Removing Util.dart and moving its remaining parts to better places (#640)
* Removing Util.dart and moving its remaining parts to better places

* Fixing lint

* Doc fixes

* Doc fixes

* PR suggestions
2021-01-25 08:53:52 -03: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
Jochum van der Ploeg
f9f4167d02 Added a required to GameWidget and updated the docs (#638)
* Added a required to GameWidget and updated the docs

* Removed entry from CHANGELOG
2021-01-20 22:11:33 +01:00
Jochum van der Ploeg
62780cabe2 Initial implementation of the Composition class. (#634)
* Initial implementation of the Composition class

* Added decodeImageFromPixels web support
2021-01-20 19:58:58 +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
Serge Matveenko
a8ef5cadea 👌 Use Offset type directly in JoystickAction.update calculations (#631) 2021-01-17 21:37:46 -03:00
Jochum van der Ploeg
33f61d2bab Added fallback support for the web on the SpriteBatch API (#612)
* Added fallback support for the web on the `SpriteBatch` API

* Refactored the SpriteBatch class
2021-01-18 00:15:13 +01:00
Erick
c462dd6913 Making SpriteComponent and SpriteAnimationComponent follow the same standard for empty constructors (#620) 2021-01-17 11:31:15 -03:00
Erick
c8dc0b45c5 Removing initialDimensions and removeGesture methods (#627)
* Removing initialDimensions and removeGesture methods

* Removing wrongly commited folder

* PR suggestion
2021-01-17 11:21:37 -03:00
Serge Matveenko
16eaef3bb1 🏷 Backport some code improvements from the null-safety branch (#603) 2021-01-08 23:25:29 -03:00
Christopher Casey
5b1988ca36 Add Timer tests and fix progress (#611)
* Add Timer tests and fix progress

* Add Timer tests & progress fix to CHANGELOG
2021-01-07 09:52:49 -03:00
Lukas Klingsbo
af53438cd4 Refactor ParallaxComponent (#613)
* Simplified loading of ParallaxComponent

* Loading helpers for the different Parallax parts

And refactor how the delta velocity works

* Fix formatting

* Break out Parallax out of ParallaxComponent

* Fix docs

* Add extension for loading different parallax things on game

* Fix formatting

* Add loadParallaxComponent extension

* Fix formatting
2021-01-06 21:07:31 +01:00
Lukas Klingsbo
90fe03dc32 Debug mode to be variable on BaseGame (#608)
* Debug mode to be variable on BaseGame

* Update debug mode docs

* Fix typo

Co-authored-by: Erick <erickzanardoo@gmail.com>
2021-01-05 20:20:52 -03:00
Erick
5517c25034 Creating a shortcut for Sprite and SpriteAnimation load (#609)
* Creating a shortcut for Sprite and SpriteAnimation load

* Adding changelod

* Lint

* PR suggestions
2021-01-05 20:17:34 -03:00
Christopher Casey
24433c18a0 Ensure non-repeating Timer callback fires (#610) 2021-01-05 20:12:39 -03:00
Luan Nico
6e98b07884 Fix aseprite constructor bug (#604) 2021-01-04 02:12:11 -05:00
Jami Couch
95f2847f06 [fix-remove-children-issue] BaseComponent removes children marked as shouldRemove during update (#600)
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-01-03 22:48:29 +01:00
Luan Nico
b1a6b68c19 Improve error handling for onLoad (#601) 2021-01-02 14:10:07 -05:00
Erick
089438c6c8 Improvements on the overlay API (#592)
* Adding game to overlaybuilder and visible overlays

* Fixing things

* Format

* Adding Renan's suggestions

* Removing wrongly commited integration test files

* Fixing active overlay when it is null

* Update CHANGELOG.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* Adding some more changes from suggestions

* Removing unnecessary elvis operator

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2020-12-30 16:37:41 -03:00
Lukas Klingsbo
480990265b BaseComponent should return immutable chlidren iterable (#594)
* Add changelog entry

* Change to Iterator to minimize performance hit

* Revert "Change to Iterator to minimize performance hit"

This reverts commit e7260aa507d4a57441e798ee0ba40cd09a776417.

* Return UnmodifiableListView for children

* Update changelog

* Add generics

* Links in comment for children getter
2020-12-29 16:32:19 +01:00
Jami Couch
a6eb12202a Fix issue in BaseComponent where addChild results in a TypeError (#593)
* [fix-add-child-issue] Fix issue in BaseComponent where addChild results in a TypeError

* [fix-add-child-issue] Change to using internal children set throughout BaseComponent
2020-12-28 20:22:39 +01:00
Lukas Klingsbo
46c025d60c Retreive -> Retrieve (#591)
* Retreive -> Retrieve

* Add changelog entry
2020-12-24 18:07:56 +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
Lukas Klingsbo
dfb3a71c4f Use config defaults for TextBoxComponent (#588) 2020-12-22 15:50:10 +01:00
Erick
98482b4255 Fixing Game Render Box for flutter >= 1.25 (#587) 2020-12-22 11:38:59 -03:00
Erick
16057aae40 Adding canvas extensions for Vector2 (#580)
* Adding canvas extensions for Vector2

* Adding changelog

* Adding export
2020-12-21 15:14:56 -03:00