91 Commits

Author SHA1 Message Date
cefe4e7599 docs: SpaceShooter Bullet SpawnComponent (#2948)
Use a `SpawnComponent` instead of a `TimerComponent` to spawn bullets on
the Space Shooter tutorial.
2023-12-21 21:06:14 +00:00
6ee9ffe50d docs: Improving collision on SpaceShooter tutorial (#2946)
Improves the collision code of the space shooter tutorial.


Replace or remove this text.
2023-12-21 15:07:57 -03:00
093a702a76 docs: Improving Space Shooter tutorial by moving attributes to constructors (#2944)
This PR improves the Space Shooter Tutorial as a whole by moving the
setting of component's attributes from their `onLoad` method, to their
constructors.
2023-12-21 17:35:25 +01:00
1b1e489040 docs: Adding Space Shooter Step 6 (#2936)
Adds the sixth step for the space shooter tutorial.
2023-12-21 15:09:22 +01:00
5fd0ba3dd5 docs: Fix sphinx warnings (#2937)
This fixes the warnings that sphinx was throwing when building.
It most likely doesn't fix the mermaid rendering though.
2023-12-20 18:35:57 +00:00
f1d94ca376 chore(release): Flame v1.13.0 (#2934)
```
Package Name           Current Version   Updated Version   Update Reason
flame                  1.12.0            1.13.0            updated with minor changes
flame_rive             1.9.8             1.9.9             updated with patch changes
flame_riverpod         5.1.0             5.1.1             updated with patch changes
flame_tiled            1.18.1            1.18.2            updated with patch changes
flame_test             1.15.1            1.15.2            dependency was updated
flame_oxygen           0.1.9+5           0.1.9+6           dependency was updated
flame_isolate          0.5.0+5           0.5.0+6           dependency was updated
flame_fire_atlas       1.4.5             1.4.6             dependency was updated
flame_audio            2.1.5             2.1.6             dependency was updated
flame_spine            0.1.1+7           0.1.1+8           dependency was updated
flame_bloc             1.10.7            1.10.8            dependency was updated
flame_lottie           0.3.0+5           0.3.0+6           dependency was updated
flame_markdown         0.1.1+5           0.1.1+6           dependency was updated
flame_svg              1.8.7             1.8.8             dependency was updated
flame_forge2d          0.16.0+2          0.16.0+3          dependency was updated
flame_noise            0.1.1+10          0.1.1+11          dependency was updated
flame_network_assets   0.2.0+10          0.2.0+11          dependency was updated
```
2023-12-19 16:40:51 +01:00
7f563d73b2 docs: SpaceShooter tutorial step 5 (#2924)
5th step of the space shooter tutorial.

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-12-18 20:32:01 +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
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
```
2023-12-08 21:09:01 +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
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
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
2722b00c75 chore(release): Flame v1.11.0 (#2885)
Release of Flame v1.11.0 and all packages.
2023-11-30 22:32:11 +01: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
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
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
10df590cc9 fix: Adjust platformer tutorial steps (#2845)
This small PR adjusts:
1. some `backticks` (`) in the platformer tutorial in order to have a
proper highlight of the file names.
2. replaces backslash (`\`) with slash (`/`) in order to be consistent
with the other file paths used in the tutorial.
3. renames the variable `_xOffset` to `xOffset` in order to be
consistent with the rest of the code.

Co-authored-by: Rodrigo Castro <rodrigo.desouzacastro@bahag.com>
2023-11-07 21:06:06 +01:00
2cc60c8fee chore(release): Flame v1.10.1 (#2837)
This releases Flame v1.10.1 et. al.
`flame_test` and `flame_forge2d` has some important changes here too.
2023-11-03 19:49:37 -03:00
276d2b72f9 fix: Finishing touches to use v1.9.x+ world and camera and complete Issue #2799 (#2824)
Previously, as part of Issue #2798, I fixed the Klondike Tutorial app's
step4 executable to use the Flame 1.9.x `world` and `camera` built-in
objects and described the new code in the Step 2 tutorial, where it
first appears in the discussion. However, the Step 2 and Step 3 tutorial
texts have options to execute code and those did not include the new
code. Accordingly, I have cloned the relevant code into
`app/lib/step2/klondike_game.dart` and
`app/lib/step3/klondike_game.dart`. I have also checked that there are
no `*.md` files to be updated. The `step2.md` tutorial file covers Issue
#2799 AFAICS.
2023-10-18 11:29:07 +02:00
eca7e41972 fix: Klondike tutorial to use built-in world and camera (#2813)
Firstly, (re Issue #2799) Flame 1.9.x broke the Klondike Tutorial, which was not set up to use the new built-in world and camera. So I modified the KlondikeGame's onLoad() code to use the built-in world and camera and no longer create its own World and CameraComponent. I also updated the step2.md documentation file, which instructs new users of Flame on how to use the world and the camera, how to set up a game-oriented co-ordinate system and how to fit it into the device screen.

Secondly, (re Issue #2798) Klondike was not adhering to the design stated in the Tutorial, that all 52 Card objects would be owned by the KlondikeGame. During the shuffle and deal sequence it was using removeLast() on the List\<Card\>cards, where the cards are kept, the result being that only 24 of the 52 cards were left in the list after the deal. I have fixed the bug and updated the Tutorial documentation (step4) which discusses how the deal is coded.

This bug does not affect the gameplay as it stands, but it does block the way to future features at the game level, such as an option to re-deal or a win-animation where all cards fly off the screen.
2023-10-15 21:08:32 +00:00
6626989bdb chore(release): Publish Flame v1.10.0 (#2816)
- flame@1.10.0
 - flame_audio@2.1.2
 - flame_bloc@1.10.4
 - flame_fire_atlas@1.4.2
 - flame_forge2d@0.15.1
 - flame_isolate@0.5.0+2
 - flame_lottie@0.3.0+2
 - flame_network_assets@0.2.0+7
 - flame_rive@1.9.4
 - flame_svg@1.8.4
 - flame_test@1.13.2
 - flame_tiled@1.15.0
 - jenny@1.1.1
 - flame_spine@0.1.1+4
 - flame_markdown@0.1.1+2
 - flame_oxygen@0.1.9+2
 - flame_noise@0.1.1+7
2023-10-12 10:09:24 +00:00
09511c2c3d docs: Update Flutter version in Bare Flame game tutorial (#2815)
Update the output of flutter doctor and the contents of pubspec.yaml to reflect 2023.
2023-10-12 11:56:27 +02:00
5b67b8f14a fix: Remove deprecations for 1.10.0 (#2809)
Removed deprecations for 1.10.0 and fixes some small unreleased regressions found when going through the examples.
2023-10-11 15:57:25 +02:00
5de3730231 chore: Bump to Flutter 3.13 (#2786)
Due to
[this](https://docs.flutter.dev/release/breaking-changes/add-applifecyclestate-hidden)
breaking change we have to bump our lowest supported Flutter version to
3.13.

This PR also adds so that we both analyze with the latest stable flutter
version and our lowest supported one.
2023-10-02 16:58:32 +02:00
ebfa3c5682 chore(release): publish packages
- flame@1.9.1
 - flame_isolate@0.5.0+1
 - flame_tiled@1.14.1
 - flame_audio@2.1.1
 - flame_spine@0.1.1+3
 - flame_svg@1.8.3
 - flame_test@1.13.1
 - flame_oxygen@0.1.9+1
 - flame_bloc@1.10.3
 - flame_fire_atlas@1.4.1
 - flame_markdown@0.1.1+1
 - flame_forge2d@0.15.0+1
 - flame_rive@1.9.3
 - flame_noise@0.1.1+6
 - flame_network_assets@0.2.0+6
 - flame_lottie@0.3.0+1
2023-09-22 16:28:53 +02:00
8b50341613 chore(release): Publish v1.9.0 (#2759)
- flame@1.9.0
 - flame_oxygen@0.1.9
 - flame_test@1.13.0
 - flame_tiled@1.14.0
 - flame_audio@2.1.0
 - flame_bloc@1.10.2
 - flame_fire_atlas@1.4.0
 - flame_forge2d@0.15.0
 - flame_isolate@0.5.0
 - flame_lint@1.1.1
 - flame_lottie@0.3.0
 - flame_markdown@0.1.1
 - flame_network_assets@0.2.0+5
 - flame_noise@0.1.1+5
 - flame_rive@1.9.2
 - flame_spine@0.1.1+2
 - flame_svg@1.8.2
 - jenny@1.1.0
2023-09-21 17:08:30 -03:00
477221998a feat(flame): Add helper methods to create frame data on SpriteSheet (#2754)
Add two methods to SpriteSheet to create frame data for SpriteAnimation
2023-09-21 11:34:02 +02:00
9c1e1c3098 chore: Remove deprecations for v1.9.0 (#2749)
Removes everything that was marked as deprecated and that should be
removed for v1.9.0.
2023-09-19 16:47:41 +02: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
93dcb3a117 fix: HasGameReference should default to FlameGame (#2710)
It doesn't make any sense for HasGameReference to have Game as a base instead of FlameGame since the mixin is on Component and clearly in a component tree context, so this PR sets the base to be FlameGame (like HasGameRef).
2023-09-10 13:15:39 +00:00
27a8fd61cb refactor: Enable DCM linting (#2667)
This is a first step towards enabling DCM for Flame. Though I have tested with all rules, and am working on selecting, assessing, and fixing violations, as a first step, we can merge the infrastructural changes to flame_lint to and GitHub actions.
As a proof of concept, I am enabling two rules for which we have no violations.
I will followup with enabling more rules, adding discussions for controversial changes, and fixing non-controversial violations.
2023-08-24 13:09:26 +02:00
9887892493 chore: Update to Flutter 3.13 (#2656)
Updates the pipeline to use Flutter 3.13 and does all the analyze fixes.
2023-08-18 20:13:17 +02:00
b26700df7e chore(release): Publish Flame 1.8.2 (#2643)
- flame@1.8.2
 - flame_lint@1.1.0
 - flame_rive@1.9.1
 - flame_tiled@1.13.0
 - flame_isolate@0.4.0+2
 - flame_audio@2.0.5
 - flame_spine@0.1.1+1
 - flame_svg@1.8.1
 - flame_test@1.12.1
 - flame_oxygen@0.1.8+5
 - flame_bloc@1.10.1
 - flame_fire_atlas@1.3.8
 - flame_forge2d@0.14.1+1
 - flame_noise@0.1.1+4
 - flame_network_assets@0.2.0+4
 - flame_lottie@0.2.1+1
2023-08-08 22:17:03 +02:00
970babe97e docs: Minor updates to steps 3 & 4 in Klondike tutorial (#2626)
I have just finished steps 1-4 of the Klondike tutorial and noticed a
couple of minor things that look to be outdated with the current dart /
flame versions.

### Step 3 - `late` keyword isn't required
When following this step the analyser hightlight this rule
[unnecessary_late](https://dart.dev/tools/linter-rules/unnecessary_late)
(introduced in Dart 2.16.0) which states:

> Top-level and static variables with initializers are already evaluated
lazily as if they are marked late.

I updated the notes around why the laziness is important so the reader
can still understand the reasoning.
2023-07-29 13:15:11 +00:00
c11fdb9940 chore(release): Publish flame v1.8.1 et. al (#2599)
- flame@1.8.1
 - flame_test@1.12.0
 - flame_audio@2.0.4
 - flame_bloc@1.10.0
 - flame_fire_atlas@1.3.7
 - flame_forge2d@0.14.1
 - flame_isolate@0.4.0+1
 - flame_lottie@0.2.1
 - flame_noise@0.1.1+3
 - flame_oxygen@0.1.8+4
 - flame_rive@1.9.0
 - flame_spine@0.1.1
 - flame_svg@1.8.0
 - flame_tiled@1.12.0
 - jenny@1.0.4
 - flame_network_assets@0.2.0+3
2023-07-02 13:40:15 +00:00
b111007b8b docs: Update step3.md of Klondike tutorial to give Card isFaceDown (#2581)
Update step3.md of Klondike tutorial to give Card isFaceDown Since that property is used in step 4.
2023-06-25 15:51:33 +00:00
034edfb22b fix: Update step3.md to use correct constructor name (#2577)
In the tutorial, the code that relies on Rank uses the .fromInt constructor, not .of
2023-06-16 20:37:40 +02:00
91fc18b1be docs: Enhance "adding the scrolling" section (#2559)
The update method should end up with the code in this order, otherwise the velocity is never set to 0.

Probably obvious but the rest of the steps were precise on where to include these code blocks.

May wanna add this full block to the end of this step as well, I spent a few minutes trying to figure out why it wasn't working propely.
2023-05-31 18:09:57 +00:00
973b5808dd chore(publish): Publish Flame v1.8.0 and bridge packages (#2557)
flame@1.8.0
flame_rive@1.8.0
flame_test@1.11.0
flame_audio@2.0.3
flame_bloc@1.9.0
flame_fire_atlas@1.3.6
flame_forge2d@0.14.0
flame_isolate@0.4.0
flame_lint@1.0.0
flame_lottie@0.2.0+3
flame_network_assets@0.2.0+2
flame_noise@0.1.1+2
flame_oxygen@0.1.8+3
flame_spine@0.1.0+1
flame_svg@1.7.4
flame_tiled@1.10.2
jenny@1.0.3
2023-05-28 18:55:47 +00:00
a54f19a405 chore(release): Publish packages (#2555)
- flame@1.8.0
 - flame_rive@1.8.0
 - flame_test@1.11.0
 - flame_audio@2.0.3
 - flame_bloc@1.9.0
 - flame_fire_atlas@1.3.6
 - flame_forge2d@0.14.0
 - flame_isolate@0.4.0
 - flame_lint@0.2.0+3
 - flame_lottie@0.2.0+3
 - flame_network_assets@0.2.0+2
 - flame_noise@0.1.1+2
 - flame_oxygen@0.1.8+3
 - flame_spine@0.1.0+1
 - flame_svg@1.7.4
 - flame_tiled@1.10.2
 - jenny@1.0.3
2023-05-28 18:24:36 +00:00
2f71e06eb8 fix: Update sdk constraints to >=3.0.0 (#2554)
Update the SDK constraint to use >= 3.0.0
2023-05-28 20:09:45 +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
b41622db8f fix: Solve warnings from 3.10.0 analyzer (#2532)
Just solves the warnings that the new Flutter version complains about (which makes us lose 10 points on pub).
2023-05-14 16:25:23 +02:00
7dd2bf7a36 docs: Remove deprecated mixin from klondike tutorial (#2535)
It just removes a deprecated line that is in the tutorial for building a Klondike game. The final code does not have it and it is no longer necessary to have it in the KlondikeGame class.
2023-05-14 12:04:34 +00:00
306ad32052 docs: Update content types of sphinx code snippets (#2519)
Update content types of some sphinx code snippets.
2023-04-25 16:28:54 +02:00
87b8a067f3 refactor!: Move CameraComponent and events out of experimental (#2505)
This moves the CameraComponent and the new event system out of experimental since this now is the recommended way of handling things.
2023-04-19 09:55:32 +02:00
89926227c5 feat: Accept CollisionType in hitbox constructor (#2509)
With this PR we accept the `CollisionType` directly in the constructor.
2023-04-18 13:57:16 +00:00
9591e28541 chore(release): Publish packages (#2504)
- flame@1.7.3
 - flame_audio@2.0.1
 - flame_bloc@1.8.4
 - flame_fire_atlas@1.3.5
 - flame_flare@1.5.4
 - flame_forge2d@0.13.0+1
 - flame_isolate@0.3.0+1
 - flame_lint@0.2.0+2
 - flame_oxygen@0.1.8+2
 - flame_rive@1.7.1
 - flame_svg@1.7.3
 - flame_test@1.10.1
 - flame_tiled@1.10.1
 - jenny@1.0.2
 - flame_noise@0.1.1+1
 - flame_network_assets@0.2.0+1
 - flame_lottie@0.2.0+2
2023-04-16 01:18:03 +02:00
dbda37b81a refactor: Add new lint rules (#2477)
This PR adds the following lint rules to our list:

```
always_put_required_named_parameters_first
avoid_multiple_declarations_per_line
avoid_positional_boolean_parameters
avoid_returning_null_for_void
avoid_returning_this
avoid_unnecessary_containers
enable_null_safety
library_private_types_in_public_api
no_leading_underscores_for_library_prefixes
no_leading_underscores_for_local_identifiers
prefer_null_aware_method_calls
tighten_type_of_initializing_formals
unnecessary_late
use_setters_to_change_properties
```

And these rules were considered, and some changes were made according to
them as a clean-up, but in many places they didn't make sense
(`prefer_asserts_with_message` I would have included, but there were too
many places that needed to be changes):

```
collection_methods_unrelated_type
prefer_asserts_with_message
avoid_renaming_method_parameters
```
2023-04-13 19:42:00 +00:00