Commit Graph

3302 Commits

Author SHA1 Message Date
Lukas Klingsbo
53f198b771 Cleaner onLoadCache variable (#982) 2021-09-29 12:11:53 +03:00
Luan Nico
8e72998b52 Make onLoad mandatory (#974)
* Fix performance issues with RC14

* Changelog

* Fix analysis

* Bring back the collidables list

* .

* .
2021-09-28 19:43:43 -03:00
Luan Nico
543cc7f05b Publish flame_test-0.1.1-releasecandidate.14 (#983) 2021-09-28 17:32:39 -04:00
Luan Nico
033b21632d Fix inconsistency on flame_test CHANGELOG 2021-09-28 17:29:22 -04:00
Lukas Klingsbo
afe12f668d Possibility to pass in a Camera to FlameGame (#981) 2021-09-28 22:55:59 +03:00
Pasha Stetsenko
e440d800ac Fix PositionComponent.toRect() (#975)
* fix .toRect()s

* Added tests

* Reduce code duplication

* restore doc on setByRect

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-09-28 14:46:03 +03:00
Pasha Stetsenko
098bfb686b No need to pre-register types in ComponentSet (#979)
* No need to pre-register types in ComponentSet

* restore register in ComponentEffect

* Added a CHANGELOG entry

* removed a sentence in comments
2021-09-28 13:21:21 +03:00
Luan Nico
6b19773800 Upgrade and move flame_tiled to the monorepo (#971) 2021-09-23 11:10:27 -04:00
Erick
02dadb2433 Adding Flame test use case methods (#963)
* Adding Flame test use case methods

* Update packages/flame_test/lib/src/flame_test.dart

* Update packages/flame_test/lib/src/flame_test.dart

* Update packages/flame_test/CHANGELOG.md

* Update packages/flame_test/example/lib/game.dart
2021-09-20 17:14:11 -03:00
Christopher Fujino
7147c05a91 increase flutter environment constraint to be at least 2.5.0 (#968)
* increase flutter environment constraint to be at least 2.5.0

* update changelog

* fix
2021-09-20 16:53:38 -03:00
Lukas Klingsbo
fa8a47f824 Fix issue with draggables not being removed properly (#964) 2021-09-20 19:11:06 +02:00
Lukas Klingsbo
6b34ea3cde Publish Flame 1.0.0-releasecandidate.14 (#962)
* Publish flame-1.0.0-releasecandidate.14

* flame_test to be path dependent
2021-09-17 14:10:15 +02:00
Lukas Klingsbo
3ebc22ad01 Publish flame_test 0.1.1-releasecandidate.13 (#961)
* Fix dev_dependencies

* Move dartdoc to dev_dependencies

* Add changelog entry

* Publish flame_test-0.1.1-releasecandidate.13
2021-09-17 12:38:45 +02:00
Lukas Klingsbo
c19f148dcc Publish flame_test 0.1.0-releasecandidate.13 (#959)
* Fix changelog

* Publish flame_test-0.1.0-releasecandidate.13
2021-09-17 00:04:08 +02:00
Lukas Klingsbo
7b51539bae Add example for flame_test (#958)
* Add example for flame_test

* Fix analyze warnings

* Fix tests
2021-09-16 20:57:04 +02:00
Lukas Klingsbo
2a7af3730b Independent test helpers (#957)
* Independent test helpers

* Relative test helper path

* Fix imports

* Fix pubspec description

* Less tested lines, since the moved lines were in tests

* Move to canvas_test
2021-09-16 13:24:45 +02:00
Lukas Klingsbo
3240d26b67 Fix base href for the gh-pages action (#953)
* Update flutter-gh-pages

* Fix base href for the gh-pages action

* Remove baseHref examples site
2021-09-15 15:38:17 +02:00
Lukas Klingsbo
55ab428a9e Collision detection between children (#943)
* Enable children of different components to collide

* Re-add import
2021-09-15 15:11:00 +02:00
Lukas Klingsbo
e3fa9f2a55 Update flutter-gh-pages (#952) 2021-09-15 14:45:05 +02:00
Vincenzo Guzzi
62fdeb78ba Markdown link updates (#944)
* Adds correct pre-release link to README.md.

* Fixes broken link to forge2d example folder

* Update doc/forge2d.md

* Replaces old pub.dartlang.org links with pub.dev links

* Adds direct links to RC13 in two other places

* Update README.md

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

* Apply suggestions from code review

* Update README-PL.md

* Update README-RU.md

* Update README-ZH.md

Co-authored-by: Vincenzo Guzzi <vincenzog@spotify.com>
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-09-15 14:22:45 +02:00
Lukas Klingsbo
a1b6ffa04a Game as a Component (#906)
* Game as a component

* Fix component stories

* Effects are now components

* Update effects docs

* Handle swap of parent

* Fix reAddChildren

* Wait for children to be added

* BaseComponent and PositionComponent to be non-abstract

* Simplify HasGameRef

* Revert so that onLoad can be null

* Fix example description

* Effects as components

* Remove gameRef from addChildren

* Fix hasGameRef

* Start migrating effects

* Updated comments of effect fields

* Fix comments

* Continue to fix sequence and combined effects

* Upgrade ordered_set

* Fix position_component_test

* BaseComponent -> Component

* Fix combined and sequence effects

* Await components to be added in tests

* Remove unnecessary game.update in tests

* Fix some tests related to composition

* BaseGame should be used in examples

* Fix CombinedEffect test

* Keyboard code to be based on Component

* Fix keyboard tests

* Fix analyze problems

* Fix sequence_effect

* Fix combined_effect_test

* Store peak state instead of end state

* Fix sequence_effect tests

* Update tutorial

* Fix tutorial 1

* Remove SimplePositionComponentEffect

* Remove unused test variable

* Update docs

* Removed onMount

* Remove onMount

* Add missing dartdoc

* Fix dart docs

* Add super.update where needed

* Move reAddChildren to component

* Reorganize method order in game widget

* preOffset -> initialDelay, postOffset -> peakDelay

* Introduce component.onParentChange

* Remove tests in wrong file

* Fix composed component test

* Add game lifecycle test

* Use BaseGame for mouse cursor test

* Oxygen should (?) not call super.update

* Use BaseGame in keyboard_test

* Fix onLoad to be properly cached

* Re-add unintentionally removed override

* Fix info for collision detection tests

* Add test for correct lifecycle on parent change

* Fix particles example

* Add component lifecycle diagram to the docs

* Add docs for the game lifecycle

* onRemove should be called when a game is removed from the widget

* Fix analyze errors

* prepare should be called from the component itself, not its parent

* Fix dartdoc

* onParentChange -> onMount

* onMount should have void as return type

* Simplify the loaderFuture in GameWidget

* Fix mock_canvas

* Fix rebase problem

* Remove asComponent

* Less complex _loaderFuture

* Add super.update to no_fcs parallax example

* Fix async tests

* Revert _loaderFuture

* Fix analyze issues

* await gameWithCollidables

* Keep epsilon small where it can be

* tappable methods should return bool

* Game lifecycle is now the same as for Component

* Remove mustCallSuper from component.update

* Make onLoadCache protected

* @internal on onLoadCache

* Cache/Memoize debugPaint and debugTextPaint

* Fix imports

* Fix comments

* Always call super.onLoad so that mixins can override it

* Add forgotten super.onLoad

* Bump coverage percentage

* HasCollidables should override update

* Fix Game comments

* Fix some dartdoc

* Apply suggestions from code review

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Game + Loadable as mixins

* Update packages/flame/lib/src/game/game_widget/game_widget.dart

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* Update loadable docs

* Fix comments

* Move fps_counter

* Fix keyboard example

* Fix dartdoc

* Remove tutorials temporarily

* Fix game lowlevel graph

* Fix resize issue

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-09-15 00:17:49 +02:00
Pasha Stetsenko
820950dc39 CameraComponent (#933)
* Viewport and combinedProjector now belong to Camera

* cleanup

* format

* fix analysis issues

* Property viewport removed from BaseGame

* Move camera & viewport into a separate directory

* added CameraComponent

* format

* .camera as computed property

* changelog note

* format

* format

* comment

* CameraComponent is no longer a Component

* Rename CameraComponent -> CameraCo

* format

* Rename CameraC -> CameraWrapper

* minor

* rename BaseGame._cameraComponent -> ._cameraWrapper

* minor fixes in response to reviewer suggestions

* Fix rendering of a ParallaxComponent

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-09-13 16:46:44 +02:00
Luan Nico
a6d051dcaa More improvements for TextBoxComponent (#941) 2021-09-11 18:43:32 -04:00
Luan Nico
bbeca1a7c0 Fix severe formatting issues across the codebase (#942) 2021-09-08 08:51:57 -04:00
Erick
3b32487cad Fixing KeyBoard events (#940) 2021-09-07 16:42:42 -03:00
Luan Nico
31a5f9c468 Fix TextBoxComponent size computation (#939) 2021-09-06 13:16:25 -04:00
Luan Nico
fcf1293865 Default sprite component size to sprite size (#938) 2021-09-06 11:27:47 -04:00
Jochum van der Ploeg
eb23eb68fe Publish flame_oxygen-0.1.0-releasecandidate.13 (#937) 2021-09-06 10:56:06 -03:00
Erick
5529869a76 Adding custom mouse cursors for flame (#935)
* Adding custom mouse cursors for flame

* linting and adding fvm to gitignore

* PR suggestions

* Apply suggestions from code review

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-09-05 20:55:26 -03:00
Jochum van der Ploeg
c015af8bee Added flame_oxygen (#823)
* Added flame_oxygen

* Reworked structure

* Added components and example

* Added particle support

* Updated code

* Update example

* Fixed mistake

* Update

* Updated documentation

* Added system documentation

* Fixed line length

* Added most components docs

* Docs done?

* Update doc/oxygen.md

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Added GameRef

* Fixed GameRef

* Reworked library to not use part system

* Added GameRef docs

* Removed library line

* Updated CHANGELOG

* Added License

* Fixed linting problem

* Update packages/flame_oxygen/example/lib/main.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update after review from spydon

* Added flipping

* Fixed CI/CD

* Fix

* Update

* Update doc/oxygen.md

Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com>

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com>
2021-09-05 23:44:29 +02:00
Lukas Klingsbo
bdb4306ac5 Function to load all images in prefixed path (#932)
* Function to load all images in prefixed path

* Add dartdoc

* Add loadAllFromPattern

* Added more supported formats

* Add dartdoc where missing
2021-09-01 11:36:16 +02:00
Renan
c833319c49 Feat: Add keyboard with focus node implementation (#909)
* Add keyboard with focus node implementation

* a

* format and make it stabel compatible

* Add mixin to game

* fixes

* add tests

* format

* docs

* more docs

* Update doc/keyboard-input.md

Co-authored-by: Erick <erickzanardoo@gmail.com>

* rename test

* Apply suggestions from code review

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* fix test

* Update tutorials/2_sprite_animations_gestures/README.md

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* docs

* Apply suggestions from code review

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

* yo

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-08-31 19:38:21 -03:00
Pasha Stetsenko
20def310e8 MockCanvas refactoring (#930)
* Start  working on new MockCanvas

* continue work on MockCanvas'

* Finish MokkCanvas class

* formatting

* Updated all tests to use MokkCanvas

* Old MockCanvas removed

* MokkCanvas -> MockCanvas

* Added doc-comments'

* format

* Added a note in CHANGELOG

* convert to function body

* reformat function bodies

* Split each canvas command into a separate file

* Improve printing of floating-point numbers in repr()

* The [tolerance] property can now be controlled by the user

* minor
2021-08-27 14:43:01 +02:00
Erick
af6c75a63e Changing where needed to reference Blue Fire instead of Fireslime (#925)
* Changing where needed to reference Blue Fire instead of Fireslime

* Fixing the remaining references

* Making LICENSE files 'real files'

* fixing references on the ES file
2021-08-23 10:37:32 -03:00
José Alfú Tochez
bc9ff5a84a 919 - Spanish Readme (#924)
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-08-22 22:41:56 +02:00
Pasha Stetsenko
9ec00d4ad7 Use Transform2D in PositionComponent (#904) 2021-08-21 19:32:32 -03:00
Ahmet Enes Bayraktar
b3d4cd12b5 body rendering (#921)
* body rendering

* update change log

* next version fix

* Update packages/flame_forge2d/CHANGELOG.md

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

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-08-20 13:57:17 +02:00
Pasha Stetsenko
acca8f0ea6 Reproducible random tests (#916)
* Added helper functions for randomized testing

* cleanup

* Changelog note

* Address reviewers' comments

* formatting

* Add comment for _maxSeed

* Gather common properties of all Elements classes into a common base class

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-08-17 12:26:38 +02:00
Jochum van der Ploeg
40fa812810 Updated Camera docs to reflect usage with Game class (#917)
* Updated docs and fixed a bug

* Update doc/camera_and_viewport.md

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update doc/camera_and_viewport.md

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update doc/camera_and_viewport.md

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update

* Update doc/camera_and_viewport.md

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* Update

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-08-17 11:14:39 +02:00
Pasha Stetsenko
97e43be866 Transform2D class (#914)
* Added Transform2D

* Added angleDegrees

* Added tests

* changelog note

* format

* fix flutter analyze issues

* Added factory constructors to NotifyingVector2

* Minor comment

* format
2021-08-11 20:13:29 +02:00
Lukas Klingsbo
53fe9e8238 Remove FPSCounter from BaseGame (#913) 2021-08-10 22:00:52 +02:00
Lukas Klingsbo
a93f838483 Fix PositionComponent.scale bug (#912)
* Add test for scale

* Fix zoom example

* Update min_coverage
2021-08-10 16:14:32 +02:00
Pasha Stetsenko
5cf7958220 NotifyingVector2 class (#907)
* NotifyingVector2 moved into a separate file

* Added a test for NotifyingVector2 class

* format

* space

* Remove prefer_mixin analysis rule

* make .storage read-only

* added a changelog entry

* format

* Reformat tests
2021-08-10 10:56:57 +02:00
Lukas Klingsbo
af60652ca4 Expose test helpers (#905)
* Expose test helpers

* Fix imports

* Fix imports
2021-08-08 19:54:31 +02:00
Lukas Klingsbo
54fbd260bc Scale for PositionComponent (#892)
* Draft of PositionComponent.scale

* Use matrix transformations

* Update tests to take matrix transform into consideration

* Add tests for collision detection with scale

* Rename ScaleEffect to SizeEffect

* Use transform matrix to prepare canvas

* Fix scaledSizeCache

* Add changelog entries and docs

* Dartdoc on public access methods

* Update packages/flame/CHANGELOG.md

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

* Move cache classes to own directory

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-08-06 21:59:52 +02:00
Pasha Stetsenko
4860cac87f #895 Fix truncated last frame of SpriteAnimation (#896)
* #895 Fix truncated last frame of SpriteAnimation

* comments

* Ensure callback is called once only, and that reset works properly

* Put the test into a separate group, since it is not 'shouldRemove'-related

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-08-05 21:31:19 +02:00
Pasha Stetsenko
02d5b5d573 SpriteComponent falls back to srcSize instead of image.size (#897)
* SpriteComponent falls back to srcSize instead of image.size

* typo

* Reformat sprite_component_test.dart
2021-08-05 14:13:50 +02:00
Erick
e43d0c021e Adding SpriteGroupComponent (#893)
* Adding SpriteGroupComponent

* fixing lint issue

* Update sprite_group_component.dart
2021-08-02 09:54:13 -03:00
Erick
4b175ccdd9 Adding playing attribute to animation component (#894)
* Adding playing attribute to animation component

* lint issues

* Update packages/flame/test/components/sprite_animation_component_test.dart

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-08-02 09:39:41 -03:00
Erick
b2ea597734 Initial implementation of paint effects (#880)
* Initial implementation of paint effects

* Improving HasPaint

* Adding color effect

* Adding exaustive tests for the HasPaint mixin

* Adding tests for the effects

* some adjustments

* Fixing some imports

* Adding docs

* Adding types to the has paint mixin

* Fixing constructor name for the opacity effect

* Apply suggestions from code review

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* Luan's suggestion

* Luan's comments

* formatting issues

* dartcodemetrics don't help me :(

* Adding assert

Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-07-31 15:58:52 -03:00