flame
A Flutter based game engine.
A 2D game engine built on top of Flutter that provides a game loop, sprite and animation support, collision detection, and optional bridge packages for physics, audio, and tile maps.
Flame is a game engine built on top of Flutter, Google's toolkit for building apps that run on mobile, web, and desktop from a single codebase. A game engine is a collection of tools and building blocks that handle the common technical problems in game development, so you don't have to solve them from scratch every time. Flame provides those building blocks specifically for Flutter developers who want to create 2D games.
The engine covers the core needs of most 2D games: a game loop (the mechanism that updates and redraws the game many times per second), a system for organizing game objects into components, sprite and animation support for loading and displaying images, collision detection so you can tell when objects hit each other, and input handling for touch, mouse, and keyboard events.
Beyond the core engine, Flame is extended through a set of optional bridge packages. These connect Flame to other specialized tools: a physics engine called Forge2D for realistic movement and gravity, audio playback, tile map editing via Tiled (a popular tool for designing 2D levels), animated vector graphics via Rive, and more. You only add the packages your game actually needs.
Flame is written in Dart, the programming language Flutter uses. To add it to a Flutter project, you include it as a dependency from pub.dev, Flutter's package registry. The repository includes runnable examples for most features that can be tried directly in a browser, along with tutorials for getting started.
The project is maintained by the Blue Fire team and is an officially recognized Flutter Favorite package, a designation Flutter gives to packages that meet a high quality bar. Support is available through a Discord server and Stack Overflow. Funding comes from OpenCollective, GitHub Sponsors, and Patreon, and the project lists Invertase as its top sponsor.
Where it fits
- Build a 2D mobile or desktop game in Flutter using Flame's built-in game loop, component system, sprite rendering, and collision detection.
- Add realistic physics to a Flutter game by combining Flame with the Forge2D bridge package for gravity, rigid bodies, and collision response.
- Design 2D game levels in the Tiled map editor and load them directly into a Flame game using the Tiled bridge package.
- Prototype a cross-platform 2D game targeting iOS, Android, and web from a single Dart codebase with Flame.