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:

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

Put the pub package as your dependency by putting the following in your pubspec.yaml:

dependencies:
  flame: 1.5.0

The latest version can be found on pub.dev.

then run 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.

Simple examples for all features can be found in the examples folder.

You can also check out the [awesome flame repository], 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: Nakama is an open-source server designed to power modern games and apps.

  • Firebase: Provides dozens of services that can be used to write simpler multiplayer experiences.

External assets

Flame doesn’t bundle any helpers to load assets from an external source (external storage or online sources).

But most of Flame’s API can be loaded from concrete asset instances, for examples, Sprites can be created from dart:uis Image instances, so the user can write custom code to load images from anywhere they need, and then load it into Flame’s classes.

Here are some suggestions for http client packages:

  • http: A simple package for performing http requests.

  • Dio: A popular and powerful package for performing http requests.

awesome flame repository