Skip to content

Commit

Permalink
Update & publish new doc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue Fire committed Dec 3, 2024
1 parent 500af1a commit 00978b9
Show file tree
Hide file tree
Showing 667 changed files with 757,905 additions and 121,994 deletions.
2 changes: 1 addition & 1 deletion docs/1.18.0/_static/apps/examples/main.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -152420,7 +152420,7 @@ i=d
h=i}s=c==="none"?B.iV:new A.qU(!1,g)
k=e.aBw(q,d)
f=e.a
return new A.RS(e.f,s,h,e.aBF(p,d),k,A.j2(o,!1),A.fX(n,f,!1),e.aBy(m),A.fX(l,f,!1),i,r)},
return new A.RS(e.f,s,h,e.aBF(p,d),k,A.j2(o,!1),A.fX(n,f,!0),e.aBy(m),A.fX(l,f,!1),i,r)},
aBB(a,b,c,d){var s,r,q,p,o,n=this,m=null,l=a.i(0,"fill")
if(l==null)l=""
s=a.i(0,"fill-opacity")
Expand Down
2 changes: 1 addition & 1 deletion docs/1.19.0/_static/apps/examples/main.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -152565,7 +152565,7 @@ i=d
h=i}s=c==="none"?B.iU:new A.qV(!1,g)
k=e.aBy(q,d)
f=e.a
return new A.RW(e.f,s,h,e.aBH(p,d),k,A.j3(o,!1),A.fX(n,f,!1),e.aBA(m),A.fX(l,f,!1),i,r)},
return new A.RW(e.f,s,h,e.aBH(p,d),k,A.j3(o,!1),A.fX(n,f,!0),e.aBA(m),A.fX(l,f,!1),i,r)},
aBD(a,b,c,d){var s,r,q,p,o,n=this,m=null,l=a.i(0,"fill")
if(l==null)l=""
s=a.i(0,"fill-opacity")
Expand Down
2 changes: 1 addition & 1 deletion docs/1.20.0/_static/apps/examples/main.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -152706,7 +152706,7 @@ i=d
h=i}s=c==="none"?B.iW:new A.qV(!1,g)
k=e.aBx(q,d)
f=e.a
return new A.RW(e.f,s,h,e.aBG(p,d),k,A.j3(o,!1),A.fX(n,f,!1),e.aBz(m),A.fX(l,f,!1),i,r)},
return new A.RW(e.f,s,h,e.aBG(p,d),k,A.j3(o,!1),A.fX(n,f,!0),e.aBz(m),A.fX(l,f,!1),i,r)},
aBC(a,b,c,d){var s,r,q,p,o,n=this,m=null,l=a.i(0,"fill")
if(l==null)l=""
s=a.i(0,"fill-opacity")
Expand Down
2 changes: 1 addition & 1 deletion docs/1.21.0/_static/apps/examples/main.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -152829,7 +152829,7 @@ i=d
h=i}s=c==="none"?B.iW:new A.qV(!1,g)
k=e.aBy(q,d)
f=e.a
return new A.S_(e.f,s,h,e.aBH(p,d),k,A.j4(o,!1),A.fY(n,f,!1),e.aBA(m),A.fY(l,f,!1),i,r)},
return new A.S_(e.f,s,h,e.aBH(p,d),k,A.j4(o,!1),A.fY(n,f,!0),e.aBA(m),A.fY(l,f,!1),i,r)},
aBD(a,b,c,d){var s,r,q,p,o,n=this,m=null,l=a.i(0,"fill")
if(l==null)l=""
s=a.i(0,"fill-opacity")
Expand Down
4 changes: 4 additions & 0 deletions docs/1.22.0/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: ce7fb4dff48a72ce57913ea9f5373460
tags: 645f666f9bcd5a90fca523b33c5a78b7
415 changes: 415 additions & 0 deletions docs/1.22.0/README.html

Large diffs are not rendered by default.

Binary file added docs/1.22.0/_images/LevelSegmentSketch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/Segment0Sketch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/Step3Platforms.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/Step4Enemies.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/Step4Ground.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/Step6HUD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/TiledEditor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added docs/1.22.0/_images/block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/ember.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/ember_quest_sketch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/ground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/heart_half.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/isometric.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/klondike-sketch.webp
Binary file not shown.
Binary file added docs/1.22.0/_images/klondike-sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/klondike-tableau-hitboxes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/orthogonal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/pointy_hex_even.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/polygon_shape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/tile-height-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/tile_stack_single_move.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/1.22.0/_images/water_enemy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions docs/1.22.0/_sources/README.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started


## About Flame

Flame is a modular Flutter game engine that provides a complete set of out-of-the-way solutions for
games. It takes advantage of the powerful infrastructure provided by Flutter but simplifies the code
you need to build your projects.

It provides you with a simple yet effective game loop implementation, and the necessary
functionalities that you might need in a game. For instance; input, images, sprites, sprite sheets,
animations, collision detection, and a component system that we call Flame Component System (FCS for
short).

We also provide stand-alone packages that extend the Flame functionality which can be found in the
[Bridge Packages](bridge_packages/bridge_packages.md) section.

You can pick and choose whichever parts you want, as they are all independent and modular.

The engine and its ecosystem are constantly being improved by the community, so please feel free to
reach out, open issues and PRs as well as make suggestions.

Give us a star if you want to help give the engine exposure and grow the community. :)


## Installation

Add the `flame` package as a dependency in your `pubspec.yaml` by running the following command:

```console
flutter pub add flame
```

The latest version can be found on [pub.dev](https://pub.dev/packages/flame/install).

then run `flutter pub get` and you are ready to start using it!


## Getting started

There is a set of tutorials that you can follow to get started in the
[tutorials folder](https://github.com/flame-engine/flame/tree/main/doc/tutorials).

Simple examples for all features can be found in the
[examples folder](https://github.com/flame-engine/flame/tree/main/examples).

You can also check out the [awesome flame
repository](https://github.com/flame-engine/awesome-flame#user-content-articles--tutorials),
it contains quite a lot of good tutorials and articles written by the community
to get you started with Flame.


## Outside of the scope of the engine

Games sometimes require complex feature sets depending on what the game is all about. Some of these
feature sets are outside of the scope of the Flame Engine ecosystem, in this section you can find
them, and also some recommendations of packages/services that can be used:


### Multiplayer (netcode)

Flame doesn't bundle any network feature, which may be needed to write online multiplayer games.

If you are building a multiplayer game, here are some recommendations of packages/services:

- [Nakama](https://github.com/obrunsmann/flutter_nakama/): An open-source server designed
to power modern games and apps.
- [Firebase](https://firebase.google.com/): Provides dozens of services that can be used to write
simpler multiplayer experiences.
- [Supabase](https://supabase.com/): A cheaper alternative to Firebase, based on Postgres.
102 changes: 102 additions & 0 deletions docs/1.22.0/_sources/bridge_packages/bridge_packages.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Bridge Packages

:::{package} flame_audio

Play multiple audio files simultaneously (bridge package for [AudioPlayers]).
:::

:::{package} flame_bloc

A predictable state management library (bridge package for [Bloc]).
:::

:::{package} flame_fire_atlas

Create texture atlases for games (bridge package for [FireAtlas]).
:::

:::{package} flame_forge2d

A Box2D physics engine (bridge package for [Forge2D]).
:::

:::{package} flame_isolate

Use isolates to offload heavy computations to another thread.
:::

:::{package} flame_lottie

Use Lottie animations in Flame (bridge package for [Lottie]).
:::

:::{package} flame_network_assets

Fetch assets over the network.
:::

:::{package} flame_oxygen

Replace FCS with the Oxygen Entity Component System.
:::

:::{package} flame_rive

Create interactive animations (bridge package for [Rive]).
:::

:::{package} flame_riverpod

A reactive caching and data-binding framework (bridge package for [Riverpod]).
:::

:::{package} flame_spine

Use Spine skeletal animations (bridge package for [Spine]).
:::

:::{package} flame_splash_screen

Add the "Powered by Flame" splash screen.
:::

:::{package} flame_svg

Draw SVG files in Flutter (bridge package for [flutter_svg]).
:::

:::{package} flame_tiled

2D tilemap level editor (bridge package for [Tiled]).
:::

[AudioPlayers]: https://github.com/bluefireteam/audioplayers
[Bloc]: https://github.com/felangel/bloc
[FireAtlas]: https://github.com/flame-engine/fire-atlas
[Forge2D]: https://github.com/flame-engine/forge2d
[Lottie]: https://pub.dev/packages/lottie
[Rive]: https://rive.app/
[Riverpod]: https://github.com/rrousselGit/riverpod
[Spine]: https://pub.dev/packages/spine_flutter
[Tiled]: https://www.mapeditor.org/
[flutter_svg]: https://github.com/dnfield/flutter_svg


```{toctree}
:hidden:

flame_audio <flame_audio/flame_audio.md>
flame_bloc <flame_bloc/flame_bloc.md>
flame_fire_atlas <flame_fire_atlas/flame_fire_atlas.md>
flame_forge2d <flame_forge2d/flame_forge2d.md>
flame_isolate <flame_isolate/flame_isolate.md>
flame_lottie <flame_lottie/flame_lottie.md>
flame_network_assets <flame_network_assets/flame_network_assets.md>
flame_oxygen <flame_oxygen/flame_oxygen.md>
flame_rive <flame_rive/flame_rive.md>
flame_riverpod <flame_riverpod/flame_riverpod.md>
flame_splash_screen <flame_splash_screen/flame_splash_screen.md>
flame_spine <flame_spine/flame_spine.md>
flame_svg <flame_svg/flame_svg.md>
flame_tiled <flame_tiled/flame_tiled.md>
```
111 changes: 111 additions & 0 deletions docs/1.22.0/_sources/bridge_packages/flame_audio/audio.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Audio

Playing audio is essential for most games, so we made it simple!

First you have to add [flame_audio](https://github.com/flame-engine/flame_audio) to your dependency
list in your `pubspec.yaml` file:

```yaml
dependencies:
flame_audio: VERSION
```

The latest version can be found on [pub.dev](https://pub.dev/packages/flame_audio/install).

After installing the `flame_audio` package, you can add audio files in the assets section of your
`pubspec.yaml` file. Make sure that the audio files exists in the paths that you provide.

The default directory for `FlameAudio` is `assets/audio` (which can be changed by providing your own
instance of `AudioCache`).

For the examples below, your `pubspec.yaml` file needs to contain something like this:

```yaml
flutter:
assets:
- assets/audio/explosion.mp3
- assets/audio/music.mp3
```

Then you have the following methods at your disposal:

```dart
import 'package:flame_audio/flame_audio.dart';

// For shorter reused audio clips, like sound effects
FlameAudio.play('explosion.mp3');

// For looping an audio file
FlameAudio.loop('music.mp3');

// For playing a longer audio file
FlameAudio.playLongAudio('music.mp3');

// For looping a longer audio file
FlameAudio.loopLongAudio('music.mp3');

// For background music that should be paused/played when the pausing/resuming
// the game
FlameAudio.bgm.play('music.mp3');
```

The difference between the `play/loop` and `playLongAudio/loopLongAudio` is that `play/loop` makes
use of optimized features that allow sounds to be looped without gaps between their iterations, and
almost no drop on the game frame rate will happen. You should whenever possible, prefer the former
methods.

`playLongAudio/loopLongAudio` allows for audios of any length to be played, but they do create frame
rate drop, and the looped audio will have a small gap between iterations.

You can use [the `Bgm` class](bgm.md) (via `FlameAudio.bgm`) to play looping background music
tracks. The `Bgm` class lets Flame automatically manage the pausing and resuming of background music
tracks when the game is sent to background or comes back to the foreground.

You can use [the `AudioPool` class](audio_pool.md) if you want to fire quick sound effects in a very
efficient manner. `AudioPool` will keep a pool of `AudioPlayer`s preloaded with a given sound, and
allow you to play them very fast in quick succession.

Some file formats that work across devices and that we recommend are: MP3, OGG and WAV.

This bridge library (flame_audio) uses [audioplayers](https://github.com/bluefireteam/audioplayers)
in order to allow for playing multiple sounds simultaneously (crucial in a game). You can check the
link for a more in-depth explanation.

Both on `play` and `loop` you can pass an additional optional double parameter, the `volume`
(defaults to `1.0`).

Both the `play` and `loop` methods return an instance of an `AudioPlayer` from the
[audioplayers](https://github.com/bluefireteam/audioplayers) lib, that allows you to stop, pause and
configure other parameters.

In fact you can always use `AudioPlayer`s directly to gain full control over how your audio is played
-- the `FlameAudio` class is just a wrapper for common functionality.


## Caching

You can pre-load your assets. Audios need to be stored in the memory the first time they
are requested; therefore, the first time you play each mp3 you might get a delay. In order to
pre-load your audios, just use:

```dart
await FlameAudio.audioCache.load('explosion.mp3');
```

You can load all your audios in the beginning in your game's `onLoad` method so that they always
play smoothly. To load multiple audio files, use the `loadAll` method:

```dart
await FlameAudio.audioCache.loadAll(['explosion.mp3', 'music.mp3']);
```

Finally, you can use the `clear` method to remove a file that has been loaded into the cache:

```dart
FlameAudio.audioCache.clear('explosion.mp3');
```

There is also a `clearCache` method, that clears the whole cache.

This might be useful if, for instance, your game has multiple levels and each has a different
set of sounds and music.
15 changes: 15 additions & 0 deletions docs/1.22.0/_sources/bridge_packages/flame_audio/audio_pool.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# AudioPool

An AudioPool is a provider of AudioPlayers that are pre-loaded with
local assets to minimize delays.

A single AudioPool always plays the same sound, usually a quick sound
effect, like a laser shooting from your ship or a jump sound for your
platformer.

The advantage of using Audio Pool is that by configuring a minimum
(starting) size, and a maximum size, the pool will create and preload
some players, and allow them to be re-used many times.

You can use the helper method `FlameAudio.createPool` to create AudioPool
instances using the same global `FlameAudio.audioCache`.
Loading

0 comments on commit 00978b9

Please sign in to comment.