294 Commits

Author SHA1 Message Date
b1a6dd18f2 docs: Added bouncing ball example in collision_detection examples and updated flame_forge2d to latest (#1868)
This PR adds two updates.

It updates the flame_forge2d to latest version i.e on pub.dev in examples and padracing projects.

Adds a bouncing ball example in the collision detection examples demonstrating a simple example of collision and bouncing of a ball from the walls around it.
2022-08-29 09:34:33 +00:00
b401c5485c docs: fix broken link for Keyboard Input Component (#1854) 2022-08-20 21:32:42 +00:00
b96432d002 chore(release): publish packages (#1852) 2022-08-19 23:22:21 +02:00
ed452dd172 feat!: Raycasting and raytracing (#1785)
This PR implements raytracing and raycasting for the built-in hitboxes.

If you pass in your own collision detection system to the HasCollisionDetection mixin you have to change the signature of that to: CollisionDetection<ShapeHitbox>instead of CollisionDetection<Hitbox>.
2022-08-19 22:44:18 +02:00
bfdc3a291b feat: Structured text and text styles (#1830)
This PR introduces the notions of structured text, and text styles, to support rendering of rich text bodies.

Specifically, we recognize that sometimes in games one needs to render pieces of text that are larger than a single word or even a single paragraph. These pieces may include: books, quest descriptions, mission objectives, tutorials, in-game help system, dialogues, etc. Rendering such a piece of text is non-trivial, however. In order to tackle this problem, I break into the following parts:

Text structure, represented as a tree of Nodes. The nodes describe the logical structure of the text, for example the document may contain a header, and then several paragraphs, and a list, where the list contains some list items, some of which having possibly several paragraphs, etc. This structure is similar to how in HTML the text is marked up with HTML tags.

Text styles are struct-like classes that contain properties describing how the text is to be styled: font size, font renderer, borders, backgrounds, margins, padding, etc. This representation is also tree-like, so that for example text inside paragraphs can have different style than text within headers, and paragraphs within lists can have different margins. A text style is similar to a stylesheet in HTML.

Text elements are the result of applying the document style to a document node: they are the "prepared" and laid out pieces, ready to be rendered. Elements are a bit like mini-components, or perhaps text "particles" in a particle system.
2022-08-10 08:13:27 +00:00
c7c4480d79 chore(release): publish packages (#1789)
* chore(release): publish packages

 - flame@1.2.1
 - flame_audio@1.3.0
 - flame_test@1.6.0
 - flame_bloc@1.6.0
 - flame_fire_atlas@1.2.0
 - flame_flare@1.3.0
 - flame_forge2d@0.12.1
 - flame_lint@0.1.1
 - flame_oxygen@0.1.4
 - flame_rive@1.5.0
 - flame_svg@1.4.0
 - flame_tiled@1.6.0

* Update packages/flame/CHANGELOG.md
2022-07-08 13:41:14 +02:00
e86630ae00 fix: Correct the imports for the padracing -> dartpad script (#1786)
After a previous update to padracing I forgot to update the script that turns it into a file that can be put into DartPad.
2022-07-08 10:33:19 +02:00
79d98d6f56 chore: Bump examples dashbook (#1766)
Updates the Dashbook version on our examples and update an example to use its new action API.
2022-07-01 09:48:43 +02:00
8384a51d65 docs: Simplify draggable example (#1754)
The draggable example was overly complicated so I simplified it.
2022-06-27 14:57:58 -03:00
5225a4ebd5 refactor: Game is now a class, not a mixin (#1751)
This simple refactor allows us to write class MyGame extends Game, instead of a more awkward class MyGame with Game. However, using ... with Game still continues to work, so no changes necessary for the users.
2022-06-25 21:32:32 +00:00
72e317f898 fix: Fix broken link for example games code (#1747) 2022-06-22 17:46:47 +00:00
c738384314 fix: Correct flutter constraint (#1731)
Pub gives a warning when using ^3.0.0 since that also implies less than 4.0.0, which your Flutter dependency shouldn't be.
With >= it is an open range instead.
2022-06-14 19:59:01 -04:00
7c653a60a2 chore: Publish flame_audio 1.2.0 (#1730)
* chore(release): publish packages

 - flame_audio@1.2.0

* fix: flame_audio should not have upper Flutter bound
2022-06-14 20:18:52 +02:00
d6bf920d28 feat!: Update flame_audio to AP 1.0.0 (#1724) 2022-06-14 00:12:47 -04:00
2a41d0d683 feat: Move to Flutter 3.0.0 and Dart 2.17.0 (#1713)
This upgrades all packages to Flutter 3.0.0 and fixes all analyze issues that came from that.
2022-06-08 06:04:40 +00:00
ad602ff963 chore: v1.2.0 changelogs (#1712)
* chore(release): publish packages

 - flame@1.2.0
 - flame_audio@1.1.0
 - flame_bloc@1.5.0
 - flame_fire_atlas@1.1.0
 - flame_flare@1.2.0
 - flame_forge2d@0.12.0
 - flame_oxygen@0.1.3
 - flame_rive@1.3.0
 - flame_svg@1.3.0
 - flame_test@1.5.0
 - flame_tiled@1.5.0
2022-06-07 16:52:55 +02:00
1efd067e31 fix: Remove nonVirtual method shouldRemove (#1707) 2022-06-07 11:43:27 +02:00
c34456b3f2 chore: Fix some of the remaining lint problems (#1706)
Fix warnings raised by the avoid_void_async lint rule;

Remove rule use_enums, which is not available in Dart 2.16
2022-06-07 07:33:04 +02:00
49252f8ef2 feat: Add more lint rules (#1703)
Adds some more lint rules and fixes the issues those rules pointed out.
2022-06-06 19:23:25 +00:00
2711ba60c2 feat: Implement tap events based on componentsAtPoint (#1661)
This PR adds a new event system based on the componentsAtPoint delivery mechanism. These events allow for a proper support of components that implement renderTree() method. The CameraComponent is one such component, with more planned in the future.

Additionally, the following improvements compared to the current tap events added:

    - the same component can be tapped with multiple fingers simultaneously;
    - a component that received onTapDown is guaranteed to receive onTapUp or onTapCancel later;
    - a component that moves away from the point of touch will receive onTapCancel instead of onTapUp (even though the game widget receives onTapUp from Flutter).

Due to the fact that the switch from the current event system to the new event system is potentially a significant breaking change, the new event system is introduced as parallel to the existing one. This way we have more time to test the new system before recommending the switch and deprecating the old one; and the switch itself should feel more gradual.
2022-06-06 15:37:01 +00:00
f55b2e0dc0 feat: Callbacks in HudButtonComponent constructor and ViewportMargin mixin to avoid code duplication (#1685)
Created a mixin to handle the margin to the viewport, mostly to remove the code duplication in ButtonComponent and HudButtonComponent, but it can also be useful in other cases when you don't want to wrap your component in HudMarginComponent.

Once the new camera system is in place this will of course have to be replaced.
2022-06-04 17:00:12 +02:00
c64aedaeb3 feat: Aligned text in the TextBoxComponent (#1620)
- Added option align in the TextBoxComponent which controls the alignment of text.
 - Added option for the TextBoxComponent to have a fixed size (before the only mode was for the textbox to automatically expand/shrink to fit the text).
2022-06-03 23:21:40 +02:00
3f28789881 feat: Added ability to render spritesheet-based fonts (#1634)
This PR adds [SpriteFontRenderer], which is a new implementation of [TextRenderer], allowing to render text based on fonts embedded into a spritesheet.

See the T-Rex game example, where the score is now rendered based on a spritesheet font.

(Also added highscore tracking for the TRex game).
2022-06-03 16:30:48 -03:00
4ca65f8a2c refactor: Add onComplete as optional parameter (#1686)
* Add onFinishCallback as optional parameter

* Rename onFinishCallback to onComplete

* Add void return for onComplete

* Add deprecated getter and setter for onFinishCallback

* Use named onComplete parameter

* Add version in which onFinishCallback will be removed
2022-06-02 06:18:38 +00:00
db336c03b6 feat: Children as argument to FlameGame (#1680)
Since we have already added children as an argument to Component, this adds it to the FlameGame.
2022-06-01 22:58:59 +02:00
1b40de094f feat: Add non_constant_identifier_names rule (#1656) 2022-05-26 20:07:37 +02:00
5f346fc51a docs: Add Padracing game to the examples (#1651) 2022-05-26 19:32:52 +02:00
489204ec68 chore: Move T-Rex to its own package (#1652) 2022-05-24 23:26:56 +02:00
c887c3616e feat: adding KeyboardListenerComponent (#1594) 2022-05-23 06:32:10 +00:00
821d01c3fa fix!: Game.mouseCursor and Game.overlays can now be safely set during onLoad (#1498) 2022-05-20 21:49:29 +02:00
e239896624 feat: Method componentsAtPoint now reports the "stacktrace" of points (#1615) 2022-05-17 20:52:43 +02:00
a448ec7dab fix: Broken links for flame_forge2d examples (#1631) 2022-05-16 16:12:56 +02:00
843ddc3624 refactor: Move to package imports (#1625)
* refactor: Move to package imports

* Fix local imports

* Removed unused imports
2022-05-15 15:04:35 +00:00
beac901313 feat: Bump to Flutter 2.10.0 (#1617) 2022-05-13 12:50:08 +02:00
c3bb14b7ca feat!: Added anchor for the Viewport (#1611) 2022-05-11 17:56:41 +00:00
4c68c2b0a2 feat: Add FpsComponent and FpsTextComponent (#1595) 2022-05-11 19:49:14 +02:00
f88200a1bf docs: Added the T-Rex example (#1602) 2022-05-08 20:07:33 +00:00
abb497abe4 feat: World bounds for a CameraComponent (#1605) 2022-05-08 18:36:56 +00:00
6dd0a970e6 docs: Move flame_forge2d examples to main examples (#1588) 2022-05-01 13:00:48 +00:00
666a2b199f feat: Adding classes for raw geometric shapes (#1528) 2022-04-27 17:39:50 +00:00
1bfed57132 feat!: Size effects will now work only on components implementing SizeProvider (#1571) 2022-04-27 19:10:01 +02:00
b99e35120d feat: Added componentsAtPoint() iterable (#1518) 2022-04-25 19:52:21 +02:00
c79d5638b7 chore(release): publish packages
- flame@1.1.1
 - flame_oxygen@0.1.2
 - flame_bloc@1.3.0
 - flame_forge2d@0.11.0
 - flame_rive@1.2.0
 - flame_svg@1.2.0
 - flame_test@1.4.0
 - flame_tiled@1.4.0
 - flame_audio@1.0.2
 - flame_flare@1.1.1
 - flame_fire_atlas@1.0.2
2022-04-12 18:08:43 +02:00
3b80c767fe chore: Release 1.1 (#1496)
* chore(release): publish packages

 - flame@1.1.0
 - flame_audio@1.0.1
 - flame_bloc@1.2.0
 - flame_fire_atlas@1.0.1
 - flame_flare@1.1.0
 - flame_forge2d@0.9.0
 - flame_oxygen@0.1.1
 - flame_rive@1.1.0
 - flame_svg@1.1.0
 - flame_test@1.2.0
 - flame_tiled@1.3.0

* feat: Bump forge2d

* chore: Bump Forge2D to 0.10.0

* docs: Update Forge2D examples to 0.10.0
2022-03-28 00:28:20 +02:00
295468f03c feat: Add Transform2D.setFrom and Transform2D.clone (#1495) 2022-03-27 21:48:26 +00:00
6891eaaa24 feat: adding ParticleSystemComponent (#1489) 2022-03-26 12:20:31 -03:00
e0125ad482 chore(release): publish packages (#1480)
- flame_audio@1.0.1-releasecandidate.1
 - flame_fire_atlas@1.0.1-releasecandidate.1
 - flame_flare@1.1.0-releasecandidate.1
 - flame_oxygen@0.1.1-releasecandidate.1
 - flame@1.1.0-releasecandidate.6
 - flame_bloc@1.2.0-releasecandidate.6
 - flame_forge2d@0.9.0-releasecandidate.6
 - flame_svg@1.1.0-releasecandidate.5
 - flame_test@1.2.0-releasecandidate.6
 - flame_rive@1.1.0-releasecandidate.6
 - flame_tiled@1.3.0-releasecandidate.6
2022-03-22 10:56:01 -03:00
4c3960c341 feat: Possibility to mark gesture events as handled (#1465) 2022-03-19 18:07:06 +01:00
e894d20133 fix: debugMode should be inherited from parent when mounted (#1469) 2022-03-19 16:13:50 +01:00
d51dc5e132 feat: Added .anchor property to CameraComponent.Viewfinder (#1458) 2022-03-18 09:08:51 +01:00