3302 Commits

Author SHA1 Message Date
6f79bc5ef9 fix: Image layers repeat indefinitely if repeated in Tiled (#2921)
Fix for #2777, images repeat along the selected axis forever in both
directions. This matches the Tiled behavior.

Closes #2777
2023-12-17 13:28:45 +00:00
bab9be6e70 fix: Allow setting bounds while BoundedPositionBehavior's target is null (#2926)
The `bounds` setter of `BoundedPositionBehavior` tries to update the
target's position when bounds are updated. But it wasn't checking if the
target is null. This was causing null exceptions while updating bounds
of an unmounted `BoundedPositionBehavior` with null target (as seen in
[this failing test
case](https://github.com/flame-engine/flame/actions/runs/7231182930/job/19704091006#step:5:1291)).
This PR fixes that by checking if the target is null before updating the
position.


Closes #2655
2023-12-17 12:07:09 +01:00
f6d4b6cef8 docs: Adding space shooter tutorial step4 (#2922)
Adds the fourth step of the space shooter tutorial.

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-15 15:11:10 -03:00
6c1b568d01 docs: SpaceShooter tutorial step 3 (#2919)
After a long time, the PR with the step 3 for the space shooter
tutorial!


Replace or remove this text.

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-15 09:30:27 -03:00
4bca3a7476 docs: Remove list of bridge packages from readme (#2918)
Replace or remove this text.
2023-12-14 13:59:19 -03:00
caf2b90930 feat: Add children to SpriteAnimationComponent.fromFrameData (#2914)
Just exposed the `children` list from `fromFrameData` constructor.
2023-12-09 19:10:55 +01:00
d12e45444e docs: Remove references to Tappable and Draggable (#2912)
We still had some references to `Tappable` and `Draggable`, this PR
removes them and removes a superfluous test for `TapCallbacks`.

---------

Co-authored-by: jonathan <sharyari@gmail.com>
2023-12-09 16:09:45 +01:00
47643f05fb chore(release): Flame v1.12.0 (#2911)
```
The following 17 packages will be updated:

Package Name           Current Version   Updated Version   Update Reason
flame                  1.11.0            1.12.0            updated with minor changes
flame_riverpod         5.0.0             5.1.0             updated with minor changes
flame_test             1.15.0            1.15.1            dependency was updated
flame_tiled            1.18.0            1.18.1            dependency was updated
flame_oxygen           0.1.9+4           0.1.9+5           dependency was updated
flame_isolate          0.5.0+4           0.5.0+5           dependency was updated
flame_fire_atlas       1.4.4             1.4.5             dependency was updated
flame_audio            2.1.4             2.1.5             dependency was updated
flame_spine            0.1.1+6           0.1.1+7           dependency was updated
flame_bloc             1.10.6            1.10.7            dependency was updated
flame_lottie           0.3.0+4           0.3.0+5           dependency was updated
flame_markdown         0.1.1+4           0.1.1+5           dependency was updated
flame_rive             1.9.7             1.9.8             dependency was updated
flame_forge2d          0.16.0+1          0.16.0+2          dependency was updated
flame_noise            0.1.1+9           0.1.1+10          dependency was updated
flame_svg              1.8.6             1.8.7             dependency was updated
flame_network_assets   0.2.0+9           0.2.0+10          dependency was updated
```
flame_lottie-v0.3.0+5 flame_test-v1.15.1 flame_audio-v2.1.5 flame_bloc-v1.10.7 flame_oxygen-v0.1.9+5 flame_fire_atlas-v1.4.5 flame_forge2d-v0.16.0+2 flame_noise-v0.1.1+10 flame_network_assets-v0.2.0+10 flame_markdown-v0.1.1+5 flame_tiled-v1.18.1 flame_rive-v1.9.8 flame_svg-v1.8.7 flame_isolate-v0.5.0+5 flame-v1.12.0 flame_spine-v0.1.1+7 flame_riverpod-v5.1.0 v1.12.0 1.12.0
2023-12-08 21:09:01 +00:00
8c3cb72541 feat: Scrollable TextBoxComponent (#2901)
This PR introduces a new ScrollTextBoxComponent, enhancing the existing
text box functionalities with scrollable text capabilities. This
component, built on top of the existing TextBoxComponent, is designed to
handle scrollable text, thereby providing a better user interface for
games that require displaying longer text content.

Added docs and and an example.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-08 19:53:45 +00:00
969a84f804 docs: Fix typo in TextComponent sample code (#2910)
This changed `=` to `:` when calling named parameter `position`.

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-08 20:46:57 +01:00
fb6a57f608 docs: Added missing text to links in camera component documentation (#2909)
Added some missing link text in the camera component documentation.

Closes #2908

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-08 19:27:30 +00:00
eef51968e7 docs: Update platformer tutorial to latest Flame (#2904)
Updates the  platformer tutorial to Flame v1.11.0
2023-12-08 16:19:09 -03:00
957db3c1ed feat: Add collision completed listener (#2896)
Add a new variable to the `CollisionDetection` class. Call
`notifyListeners` at the end of the collision detection step, so that
users can add a listener to their code to know when this step has
finished. The variable is a basic implementation of a `Listenable`
class, since it needs no more complexity.


Closes #2849
2023-12-06 21:45:11 +00:00
16a45b27a2 docs: Klondike Step5, re-work drags and taps (#2894)
The objective of this fix is to make a tap on a card more
positive-feeling for the player and not to disappear silently if it is
interpreted as a drag.

It adds a Base Card to make an empty Stock Pile behave as a Card and use
the tap and drag logic of the `Card` class. Any attempted drag on a
Stock Pile card, including the Base Card, is now changed to a tap in
onTapCancel() and the drag is not followed. The Base Card is rendered in
outline only and does *not* take part in gameplay.

In other Piles a short drag is either treated as a tap or ignored. Only
the Waste and Tableau Piles allow such taps. As before in Klondike
Step5, they result in the tapped card moving automatically to its
Foundation Pile if it is eligible to "go out".

As before in Klondike Step4 and Step5, all piles except the Stock Pile
allow drags to start on them and they can finish on a Foundation Pile or
a Tableau Pile.

Closes #2890.

When testing, try sliding the finger or mouse slightly while making a
tap.

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-06 21:04:52 +01:00
001c870d61 feat: Adding autoResetTicker option to SpriteAnimationGroupComponent (#2899) 2023-12-06 10:01:34 +01:00
2e96dcd03e docs: Fix a typo on the docs where global was written as game (#2898)
A simple typo fix on the docs.
2023-12-04 08:02:22 +01:00
d4decd21eb feat: Add clearSnapshot function (#2897)
The Snapshot mixin was missing a function to clear the snapshot. This is
useful for when you want to invalidate the picture, but don't want to
immediately pre-render the image yet.
2023-12-04 05:53:51 +01:00
a31486fc30 fix: Issue #2889, Klondike Step5, incorrect animation of the deal. (#2893)
When the cards are dealt at the start of a Klondike Step 5 game there
are multiple occurrences of unrealistic behaviors:

- Several cards being dealt may come from the middle of the Stock Pile,
- Cards that are dealt early can be seen moving in front of cards that
are dealt later.

Each card dealt should be rendered on the top of the Stock Pile and
should be seen to come from there. During the deal, later cards dealt
are placed on top of earlier ones, so later cards should be seen to move
in front of earlier ones when they are travelling from the Stock Pile to
their positions in the layout.

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-02 09:19:06 +00:00
9aed8b4dea fix: SpriteAnimationWidget was resetting the ticker even when the playing didn't changed (#2891)
`SpriteAnimationWidget` was incorrectly reseting its `animationTicker`
everytime it had a change, even if the playing attribute did not change.
This PR fixes that.
2023-12-01 12:30:55 -03:00
0c74560b2e feat: Integration of flame_riverpod (#2367)
Previously discussed with @spydon and referenced in issue #2353,
flame_riverpod is to be integrated into the monorepo.
2023-12-01 08:39:02 +00:00
81930e2384 docs: Update t-rex game to use TapCallbacks (#2888)
Update t-rex game to use `TapCallbacks` instead of `TapDetector`, in
anticipation of [deprecating the
latter](https://github.com/flame-engine/flame/pull/2886).

Also update the term high score to avoid a dictionary entry.

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-01 08:19:17 +00:00
1aa4098dd2 docs: Add index page with routing links to doc/flame/examples (#2887)
Add an ad-hoc index page with routing links to all examples within
doc/flame/examples.

Before, it would just show a cryptic error message that would require
checking the code to understand how to access a specific one.

These examples are used with route pre-set within the docs so they are
not normally accessed by users directly, however this is helpful when
you refactor something and wish to double-check the examples still work.


![image](https://github.com/flame-engine/flame/assets/882703/10212a11-6c2b-4308-a8cd-5a05658bec71)

Obviously it could be improved further, but this already helps finding
what you seek quickly.
2023-12-01 09:00:09 +01:00
2722b00c75 chore(release): Flame v1.11.0 (#2885)
Release of Flame v1.11.0 and all packages.
flame_network_assets-v0.2.0+9 flame_markdown-v0.1.1+4 flame_forge2d-v0.16.0+1 flame_isolate-v0.5.0+4 flame_test-v1.15.0 flame_oxygen-v0.1.9+4 flame_spine-v0.1.1+6 flame_bloc-v1.10.6 flame_tiled-v1.18.0 flame_audio-v2.1.4 flame_fire_atlas-v1.4.4 jenny-v1.2.1 flame-v1.11.0 flame_lint-v1.1.2 flame_rive-v1.9.7 flame_svg-v1.8.6 flame_noise-v0.1.1+9 flame_lottie-v0.3.0+4 1.11.0 v1.11.0
2023-11-30 22:32:11 +01:00
06fdeac684 docs: Update flame_isolate to point at repository (#2880)
Update flame_isolate to point at repository
2023-11-30 14:02:41 -05:00
63994ebcd8 fix!: Add DisplacementEvent to fix delta coordinate transformations for drag events (#2871)
This adds `DisplacementEvent` to fix delta coordinate transformations
for drag events, to be used instead of `PositionEvent`.
Drag Events now expose the start and end position, as well as the delta,
correctly transformed by the camera and zoom.
This also ensures that drag events, once starts, do not get lost if the
drag update leaves the component bounds.



* if you are using `DragUpdateEvent` events, the `devicePosition`,
`canvasPosition`, `localPosition`, and `delta` are deprecated as they
are unclear.
* use `xStartPosition` to get the position at the start of the drag
event ("from")
* use `xEndPosition` to get the position at the end of the drag event
("to")
* if you want the delta, use `localDelta`. it now already considers the
camera zoom. no need to manually account for that
* now you keep receiving drag events for the same component even if the
mouse leaves the component (breaking)

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2023-11-30 16:40:26 +01:00
07ef46cab0 feat: Using viewport scale on debug mode text paint (#2883)
Consider viewport scaling into the text paint used in the debug
information of components.

Fixes #2881
2023-11-29 13:26:27 -03:00
0fd2662d4b refactor!: Replace Offset with opacityFrom and opacityTo in ColorEffect (#2876)
`ColorEffect`'s API was a bit confusing because it used `Offset` for
getting values of opacity start and end from user. This PR changes that
to use optional `opacityFrom` and `opacityTo` double parameters. It also
adds validate checks on these value to make sure that are between 0 and
1.
2023-11-27 14:21:18 +01:00
f4ff31174a fix: Removing spine flutter overriding (#2877)
`spine_flutter` got a new release recently, which fix the issue that the
dependency overriding was handling, so this PR removes the dependency
override and updates the package.
2023-11-27 13:56:39 +01:00
f42d0e73be docs: Fix naming of drag- and tap-callbacks examples (#2873)
Fix naming of drag- and tap-callbacks examples
2023-11-26 17:55:35 +00:00
685e1d9529 feat: Make Viewfinder and Viewport comply with CoordinateTransform interface (#2872)
Make `Viewfinder` and `Viewport` comply with `CoordinateTransform`
interface; they already perform the coordinate transform operation but
didn't technically implement then interface.
2023-11-26 17:39:29 +00:00
37f7b12f57 fix: Use world on tap_callbacks_example (#2875)
Use world on tap_callbacks_example. We should just standardize all
examples to use the world unless there is a reason not to, in order to
avoid confusing users.
2023-11-26 17:32:59 +00:00
39edc70206 docs: Fix Hover Callbacks so the tap used in the example respects the zoom (#2874)
Fix Hover Callbacks so the tap used in the example respects the zoom.

The example happens to use a tap event to create new squares. However,
since the tap event is bound to the Game instead of the World, had it
had any zoom applied (which it didn't), or any other camera transform,
the squares would have been created on the wrong place. This sends a bad
example to new users and can cause confusion.
2023-11-26 18:26:00 +01:00
501506810b docs: Fix EmberQuest tutorial typos (#2870)
Fix EmberQuest tutorial typos described in issue #2869 


Closes #2869
2023-11-26 12:05:15 +01:00
d0c10cbbea feat: Adding configurable padding to Tiled atlas packing (#2868)
Adds new configurations to Flame Tiled's atlas packing. Spacing which
can be used to tilesets are not too close to each other in the atlas,
something that can cause texture leaking causing weird rendering issues.
2023-11-24 11:39:17 -03:00
212cc206b9 docs: Klondike Tutorial Step 5 (#2842)
Primarily this PR is completing Step 5 of Flame's Klondike Tutorial and removing the tbc.md file ("To be continued...").

As at the end of Step 4, the Klondike Game had no animation, other than the drag-and-drop moves to play the game. It also had no ways to detect a win, react to a win or play again without re-loading and re-running the whole app. Step 4 played the Klondike Draw 3 variation of Klondike. Step 5 introduces the easier Klondike Draw 1 variation and provides buttons to:

Choose between Draw 1 and Draw 3,

Start the game again with a new deal, or

Start again with the same deal as before.

The new code and step5.md tutorial text cover Effects and EffectControllers in some detail, with complex examples of their use. The animations include:

Returning dropped but misplaced cards to the places they came from,

Settling dropped and validly placed cards into position,

Flipping cards from Stock Pile to Waste Pile,

Turning cards over on the Tableau piles when the cards above them are moved away,

Collecting multiple cards when the game is over,

Dealing and re-dealing multiple cards,

Allowing a card to be auto-moved onTapUp() to its Foundation Pile if it is ready to go out,

Providing a display of moving cards when/if the player wins.
2023-11-24 07:27:24 +00:00
e56ad18783 fix: TiledComponent.atlases had duplicated values (#2867) 2023-11-23 14:12:50 -03:00
e1b4d93ad4 feat: Exposing atlases for reading in a TiledComponent (#2865)
Adds a `componentAtlases` in the `TiledComponent` which can be useful
for debugging purposes, where the developer will be able to inspect the
atlases being used in their game.
2023-11-23 15:08:52 +00:00
ee11aae9f5 feat: Allow sequence effect to be extended (#2864)
With previous implementation of the `SequenceEffect` didn't allowed
developers to extend it and create custom sequence effects. This PR
slightly refactors the class so it can now be extended.
2023-11-23 15:00:00 +00:00
082743d3ba feat: Adding children argument to all constructors in the shape components (#2862)
Some constructors in the shape components were missing, this PR adds
them.
2023-11-22 15:57:34 +01:00
208d7897f1 feat: Optimization in sprite batch (#2861)
SpriteBatch optimization by passing colors and blend mode only when the developer informed one.
2023-11-21 17:06:34 -03:00
6269551a77 feat: Add TimeTrackComponent and ChildCounterComponent (#2846)
Adds TimeTrackComponent and a ChildCounterComponent to help developers track down perfomance issues in their game.
2023-11-21 08:19:03 +01:00
79262c7c65 docs: Fix issue with Flame section opening when pressing Jenny (#2857)
Currently the Flame section opens up when you press jenny due to a
script that we have looking for `index.html`, this PR renames those
pages to be in line with the rest of the docs.

Thanks for reporting it @incendial
2023-11-20 16:10:30 -05:00
fbfae34199 docs: Add tiles folder to structure docs (#2860)
Details about the `tiles` folder was missing from the `proposed folder
structure` docs, so this PR adds that.


Closes #2859
2023-11-18 13:28:10 +01:00
d51cd584c7 fix: Minor issues due Flutter 3.16 (#2856)
With the last Flutter version, a few issues were introduced in Flame sourcebase. This PR solves that.
2023-11-16 17:50:39 -03:00
717363bcfb chore(release): Publish flame_tiled 1.17.0 (#2854)
- flame_tiled@1.17.0
2023-11-15 16:40:23 -03:00
2f0dab9e59 fix: Configuration useAtlas was not been propagated correctly everywhere (#2853)
The useAtlas configuration was not being propagated correctly in all of the places. This PR fixes that.
2023-11-15 09:58:10 -03:00
f7334439c9 ci: Bump melos-action to v3 (#2850)
Bump the `melos-action` to v3, where only yaml is used instead of
separate scripts.
2023-11-15 08:09:05 +00:00
e893d1152c feat: Adding way to configure a layer paint in flame tiled (#2851)
Creates a configuration in Flame Tiled that allows developers to use custom paint objects which can be useful when we need to render tilesets that require a different Paint configuration other than the default one. Like low rez pixel art tilesets which benefits from using filterQuality.none
2023-11-14 18:57:35 -03:00
c4efb4f859 feat: Expose useAtlas on Flame Tiled (#2852)
Flame Tiled uses SpriteBatch under the hood to render its tiles. That API has a flag called useAtlas that when false allows rendering to be done through drawImageRects instead of drawAtlas.

There were not way to set that through Flame Tiled though. This PR exposes that as an option for the developer.
2023-11-14 17:13:39 -03:00
aa64ca0e38 chore(release): publish packages
- flame_rive@1.9.6
flame_rive-v1.9.6
2023-11-10 15:58:29 +01:00