170 Commits

Author SHA1 Message Date
51a896b2c8 feat: clampLength for Vector2 extension (#2190)
With this method you can clamp the length of a vector, instead fitting it in a box like clamp and clampScalar does.
2022-11-25 14:36:18 +00:00
3a73d1456c feat: Lottie bridge package (#2157)
This PR adds support for Lottie animations to flame
2022-11-22 21:42:15 +00:00
93dc432547 fix!: Correct coordinate system for a circular viewport (#2174) 2022-11-20 19:11:47 +01:00
9870eadaad docs: Fix bad links in docs as well as minor updates (#2170)
Closes: #2169

As discussed, a quick fix to some bad links and while I was in Flame Isolate, fixed some bad grammar.
2022-11-16 16:11:36 +01:00
cbfa789e75 chore: Fix some spelling mistakes (#2148)
Fix all* typos reported by CSpell, and add some more words into the dictionaries.

(Except for two in the flame_isolate/example package).
2022-11-06 14:06:44 +00:00
4bf9563013 chore: Fix some spelling errors (#2146) 2022-11-05 12:17:48 +01:00
b25b935644 feat: FlameIsolate - a neat way of handling threads (#1909)
Adding a bridge library for integral_isolates adding support for components to run CPU intensive code with a function similar to Flutter's compute function, but with a long lived isolate. Lifecycle is handled by the game loop, where the isolate would live between onMount and onRemove.
2022-10-31 21:06:27 +01:00
03751a2f54 docs: SpriteAnimation benchmark example (#2131) 2022-10-29 13:49:03 -04:00
bcecd3c1bd feat: Added glow effect using maskFilter (#2129) 2022-10-29 17:44:15 +01:00
9e6bf4fbcc feat: Add paint layers to HasPaint and associated component renders (#2073) 2022-10-24 22:37:24 +00:00
bc43838c92 docs: Add performance test game to examples (#2117) 2022-10-24 22:57:46 +02:00
6fe517a0c2 ci: Added Spell checker in CI (#2006)
Added spell check in Github CI
2022-10-22 16:51:00 +02:00
b5780d4212 feat: Add support for styles propagating through the text node tree (#1915)
This PR continues the work for enabling rich text support within Flame.
Here I add support for different text fragments having different TextStyles, and allow those styles to be inheritable within the text node tree.
2022-10-08 11:08:18 +00:00
dfb94d1a34 fix: Audio Fixed for live examples (#2044) 2022-10-08 12:59:13 +02:00
6b78b10fb3 feat: Add optional maxDistance to raycast (#2012)
This PR adds an optional parameter to raycast API called maxDistance. Using this parameter users can control the limit within which raycast scans for hits.
2022-10-07 14:13:42 +02:00
475b226911 docs: Fixed broken example links (#2030) 2022-10-06 10:15:32 +02:00
e33d5410a3 feat: quad tree broadphase support (#1894)
Quad tree broadphase support.
2022-09-27 13:53:27 +02:00
6410dc753c feat: Animated tile support! (#1930)
Tiled supports animated tiles, and now Flame does as well...
2022-09-23 16:55:15 +02:00
deccb4349d feat: Add avoid_final_parameters, depend_on_referenced_packages, unnecessary_to_list_in_spreads (#1927)
Adds these three sensible rules:

avoid_final_parameters

depend_on_referenced_package

unnecessary_to_list_in_spreads
2022-09-20 21:23:43 +02:00
720c3566b0 feat: Add lookAt method for PositionComponent (#1891)
This PR adds a new method called lookAt for PositionComponent. It is a convenience method which rotates the component to make it point towards/look at the given target position.

Additionally, this PR also adds a angleTo method which can be used to get the calculated angle for lookAt. It will be useful if someone want to smoothly rotate towards target using effects or manual lerping.
2022-09-18 20:57:07 +02:00
5bdb2a1ec8 docs: Improve keyboard input examples (#1907)
This PR updates the live keyboard examples to correctly handle multiple key inputs. This was discovered in #847.
2022-09-15 08:13:05 +02:00
f34d86db1e feat: Adding ClipComponent (#1769)
Adds a new component called ClipComponent that clips the canvas area based on its size and shape.
2022-09-13 12:52:11 +00:00
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
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
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
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
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
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