14 Commits

Author SHA1 Message Date
2fd84c846f feat!: Update flame_noise to use latest version of fast_noise (#3015)
Update flame_noise to use the latest version of fast_noise, basically
replacing the Perlin-specific effect controller with a generic
`NoiseEffectController` that can take in any noise class (leveraging the
new Noise2 interface).

Just update from `PerlinNoiseEffectController` to
`NoiseEffectController` and provide the noise/parameters you want
directly into the `noise` field.

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2024-02-04 16:37:54 +01:00
7c2f400076 feat!: Add CameraComponent to FlameGame (#2740)
This PR adds the `CameraComponent` and a `World` by default to the
FlameGame.
2023-09-18 21:06:37 +02:00
83f5ea45dc feat: SpawnComponent (#2709)
This PR introduces the `SpawnComponent`, which randomly spawns
components within a set area.
2023-09-10 17:55:30 +02:00
2d45d2be39 chore: Remove 1.8.0 deprecations (#2538)
Removes all the deprecated methods before 1.8.0 release.
2023-05-22 19:01:55 +02:00
b2fdf06a79 feat: Introduce flame_noise, deprecate NoiseEffectController (#2393)
This:

* Deprecates the NoiseEffectController that is based on the deprecated
vector_math library impl
* Adds a new bridge package `flame_noise` to bridge fast noise

Note: the *goal* of this PR is to allow the immediate deprecation of the
old NoiseEffectController by providing an experimental, suitable
replacement. I believe the package flame_noise will look nothing like
this at all if I am able to land [some improvements to the underlying
fast_noise lib](https://github.com/frankpepermans/fast_noise/pull/5). We
will be able to have for example a generic NoiseEffectController.

However I believe we should merge this as an experimental package for
now to unblock removing the current implementation from Flame which is
negatively affecting our scores on pub. Therefore I would advise we
don't spend any time discussing specifics of how the API/impl provided
for the flame_noise, and just go with _something_ instead of nothing.
2023-03-14 20:59:21 -04:00
29dd09ca92 feat(collision detection)!: Use a broadphase to make collision detection more efficient (#1252) 2022-03-07 09:08:32 +01:00
fad9d1d54f feat: Added NoiseEffectController (#1356) 2022-02-06 13:43:12 +01:00
96991122f4 MoveAlongPathEffect (#1172)
* MoveAlongPathEffect separated from MoveEffect

* rename _lastPosition -> _lastOffset

* Added absolute= flag in MoveAlongPathEffect

* added test for absolute path

* add oriented= flag

* added test

* changelog

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-12-07 20:45:53 +01:00
bfcda073bb Effect controllers restructuring (#1134)
* Update effectController

* move effect controllers into the controllers/ directory

* Add .forward property to EffectController

* SimpleEffectController supports reverse time

* Fixing some compile errors

* rename SimpleEffectController -> LinearEffectController

* minor cleanup

* DurationEffectController and PauseEffectController

* ReverseLinearEffectController

* CurvedEffectController and its reverse

* InfiniteEffectController

* Added EffectController.recede()

* Add EffectController.update()

* Add InfiniteEffectController'

* RepeatedEffectController

* SequenceEffectController

* DelayedEffectController

* Restore the [EffectController.started] property

* minor

* Rename reset() -> setToStart()

* time direction is now managed from the Effect class

* StandardEffectController replaced with function standardController()

* update some doc-comments

* flutter analyze

* flutter format

* fix some tests

* more test fixes

* fix remaining tests

* format

* rename local variable

* minor simplification

* Expand docs in PauseEffectController

* added tests

* Curved controller test

* fix errors

* formatting

* added more tests

* format

* fix RepeatedEffectController

* more tests

* format

* changelog

* increase tolerance

* Replaced standardController with factory EffectController constructor

* Added parameter EffectController({alternate=false})

* Added default for curve= parameter

* rename

* rename tests

* added more exports

* rename tests

* rename src/effects2

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-12-04 15:58:42 +00:00
790b8f73dd Remove old effects system (#1157)
* Remove old effects system

* Add changelog entry
2021-12-03 15:02:25 +01:00
8b132d7c0b Unify examples structure (#1118)
* Animations, CameraAndViewport, CollisionDetection and Components unified

* Added descriptions to effects

* Rename input games

* Unify input stories

* Add info to parallax section

* Added descriptions to the rendering examples

* Add descriptions to the sprites directory

* Fix utils and rendering section

* Add descriptions to the widgets section

* Delete directory that rebase brought back

* Unify game names

* Added some styleguide docs for examples

* Fix analyze issues

* All files should have _example as suffix

* Made the FollowComponentExample a bit easier to understand

* Change priority of ember
2021-11-19 14:28:04 +01:00
cd7a0bbb65 ShapeComponent and Hitbox to take transform of parents full ancestor tree into consideration (#1076)
* `ShapeComponent` changes size, position and angle of underlying Shape

* Added description to ShapeComponent

* Fix test

* Update packages/flame/lib/src/components/shape_component.dart

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

* Add absoluteScale and absoluteAngle to PositionComponent

* Refactor ShapeComponent

* Should be scaled by total scale, not scaled size

* Premature optimization for creation for objects in Polygon

* Use path for default Polygon constructor

* Do not sync component and hitbox shape

* Fix analyze issue

* Add example for flipping with collision detection

* Don't use absoluteScale

* Fix examples

* Fix examples

* Doesn't need super.render

* Fix Circle dartdoc

* Update changelog

* Update names of vertices caches in Polygon

* Update text docs

* Revert "Update text docs"

This reverts commit 73a68a465d76eb0eb50bb3753e57b2f4e3b5a7f4.

* Fix examples

* ShapeComponents docs

* Move example games to the top

* Fix dartdoc comment about polygon vertex relation

* Fix order of polygon vertices in dartdoc

* Fix anchor for PolygonComponent.fromPoints

* Add test with ancestors

* Update doc/components.md

Co-authored-by: Pasha Stetsenko <stpasha@google.com>

* Update doc/components.md

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

* Rename example classes

* Fix linting issues in examples

* Don't use px

* Use isTrue and isFalse

* Update doc/components.md

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

* Fixed comments on PR

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Pasha Stetsenko <stpasha@google.com>
2021-11-13 16:00:24 +01:00
d53ac50859 Add flame_lint to examples (#1090) 2021-11-12 10:35:56 +01:00
3abde23450 Move effects (#1077)
* Added MoveEffect

* formatting

* update comments

* Add example for move effects

* Added tests

* changelog

* flutter analyze

* avoid creating newPosition object

* added a trailing comma

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-07 20:38:47 +00:00