Commit Graph

383 Commits

Author SHA1 Message Date
Luan Nico
f6db096ac6 Small fixes and nits to make null-safe simpler (#686) 2021-02-26 09:45:50 -05: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
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
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
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
Luan Nico
12cafb1da3 Draggables Overhaul (#660) 2021-02-15 14:06:35 -05:00
Luan Nico
8e2ba4a4bf Remove old examples that have already been ported (#656) 2021-02-10 20:24:35 -05:00
Lukas Klingsbo
b1fa449dae Migrate RaisedButton -> ElevatedButton (#654)
* Migrate RaisedButton to ElevatedButton

* Add changelog entry
2021-02-09 20:22:03 -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
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
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
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
Jochum van der Ploeg
9890ad73ed Updated the widgets docs (#628)
Co-authored-by: Erick <erickzanardoo@gmail.com>
2021-01-17 11:17:15 -03:00
Serge Matveenko
11d93c23b2 👌 Throw exception from parseAnchor in examples/widgets instead of returning null (#632) 2021-01-17 11:10:03 -03:00
Serge Matveenko
16eaef3bb1 🏷 Backport some code improvements from the null-safety branch (#603) 2021-01-08 23:25:29 -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
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
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
692213d5a4 Properly propagate onMount and onRemove to children (#579)
* Fix rendering of children

* Game loop handles other restore

* Properly propagate onMount and onRemove to children

* Use BaseGame on gestures to minimize confusion

* Fix linting

* All children don't need preparation

* Add composability example

* gameRef might not be defined

* Add mustCallSuper

* isMounted on game

* Remove unused gameRef argument

* Made isMounted only modifiable by the component

* Move dartdoc to public isMounted

* Fix formatting
2020-12-21 12:42:45 +01:00
Luan Nico
c784047ce5 Rename the layer folder to layers to be consistent with other similar packages (#576)
Co-authored-by: Erick <erickzanardoo@gmail.com>
2020-12-20 14:15:48 -03:00
Lukas Klingsbo
bd8257402b Rename Dragable -> Draggable (#575)
* Rename Dragable -> Draggable

* Hide ambigious class

* Add changelog entry

* Update docs
2020-12-19 01:10:17 +01:00
Erick Zanardo
6e56c23930 Some more linting 2020-12-12 15:42:42 -03:00
Erick Zanardo
2e6da04930 Fixing lint 2020-12-12 15:17:40 -03:00
Erick Zanardo
11511b98a8 Moving size from BaseGame to Game 2020-12-11 11:45:23 -03:00
Lukas Klingsbo
2291002066 Update docs to take margin/padding into account 2020-12-09 10:22:36 +00:00
Lukas Klingsbo
598436a3cb isDragged -> isDragging 2020-12-09 10:22:36 +00:00
Lukas Klingsbo
463c30c374 Support dragable components 2020-12-09 10:22:36 +00:00
Erick Zanardo
8d7dd46806 PR suggestions 2020-12-09 10:10:13 +00:00
Erick Zanardo
f248835444 Fixing some examples 2020-12-09 10:10:13 +00:00
Erick Zanardo
e4abb8f999 Removing minotaur article source from flame sourcebase 2020-12-09 10:10:13 +00:00
Erick Zanardo
4f7c1065e5 Fixing animation example 2020-12-09 10:10:12 +00:00
Renan
2f2ab1341e game widget (#533) 2020-12-09 10:10:12 +00:00
Luan Nico
4f989e49f5 Unify multiple render methods on Sprite 2020-12-09 10:10:12 +00:00
Lukas Klingsbo
98ad12d269 Use relative imports 2020-12-09 10:10:12 +00:00
Lukas Klingsbo
46554507a7 Tapables need to be handled in reversed priority order 2020-12-09 10:10:11 +00:00
Lukas Klingsbo
8665172ed9 Take angle into account for taps 2020-12-09 10:10:11 +00:00
Lukas Klingsbo
d09d2bd449 Add TextBoxConfig options and fix TextBoxComponent bugs (#534)
* Add TextBoxConfig options and fix TextBxoComponent bugs

* Add changelog entry

* Fix snackbar deprecation

* All examples to have publish to none

* One argument per line

* No explicit types for local variables

* Cache the width

* Fix formatting
2020-12-09 10:07:35 +00:00
Lukas Klingsbo
4a3f9778a4 destroy -> remove for components 2020-11-15 14:54:35 +01:00
Lukas Klingsbo
2b9166db08 Test CombinedEffects that contain alternating effects 2020-11-07 15:21:21 +01:00
Lukas Klingsbo
39c2663798 Function for set component to init state 2020-11-07 15:21:21 +01:00
Lukas Klingsbo
bd22660800 Remove unnecessary part from SequenceEffect update 2020-11-07 15:21:21 +01:00