Package selection guidance compiled from public package information, community data, and project usage.
Bonfire is a Flutter/Dart package designed to simplify the creation of RPG-style games using Flame, a game engine for Flutter. It provides high-level abstractions for common RPG mechanics such as character movement, combat, dialogue systems, and map management. Built with developers in mind, Bonfire reduces boilerplate code and accelerates prototyping by offering ready-to-use components like tilemaps, NPCs, and player controllers. Ideal for indie developers and hobbyists aiming to build 2D turn-based or real-time RPGs with minimal setup.
Use cases
Developing 2D RPG games
Creating turn-based or real-time combat systems
Building interactive story-driven games
Prototyping game mechanics quickly
Implementing tilemap-based worlds
Key features
Built on top of Flame game engine
Predefined RPG components (NPCs, players, maps)
Support for dialogue and quest systems
Easy integration with Flame's rendering and physics
Cross-platform deployment support
Suitable for
Indie game developers
RPG enthusiasts
Flutter developers new to game development
Prototypers seeking rapid iteration
Those building 2D side-scrolling or tilemap games
Considerations
Requires familiarity with Flame
Limited to 2D game types
Best suited for RPGs, not other genres
May require additional customization for complex mechanics
Depends on Flame's stability and updates
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Bonfire
Build RPG-style games (and beyond) with the power of FlameEngine! 🎮
🕹️ Input — Joystick, keyboard and mouse controls with 8-direction movement.
⚔️ Combat — melee and ranged attacks, projectiles, damage feedback and life bars.
🧠 Behaviors & AI — behavior trees (BSelector, BParallel, BOnce), pathfinding, random movement, sensors and vision.
🎨 Effects & polish — particles, lighting, shaders, camera effects, parallax, color filters and force physics.
🖥️ Game interface — life bars, dialogs, text effects, minimap and HUD components.
📱 Multi-platform — mobile, desktop and web with Flame.
🎮 Bonfire 4.0 — what's new
Version 4.0 is a major restructuring of the API surface, focused on developer experience when building complex game components.
In previous versions each mixin added methods and fields directly to the component. With several mixins (Movement, Jumper, Sensor, PathFinding, Pushable, RandomMovement...), the component namespace became crowded and autocomplete less useful.
Starting with 4.0, mixins follow a consistent WithFeature + feature.{resource} pattern:
Simplified, velocity-based Movement — the only mixin that keeps its direct access style, but was rewritten: direction/hDirection/vDirection now reflect the current velocity, stop()/idle() replace the old stop helpers and legacy members (lastDirection, stopMove, setZeroVelocity, moveFromAngle, *Once, acceleration...) were removed.
Event-driven collision — WithCollision exposes collision.onBlockMovementListener(...) and a bodyType API instead of the old BlockMovementCollision overrides.
Direction animations — SimplePlayer/SimpleEnemy drive their 8-direction sprite animations (SimpleDirectionAnimation) from direction automatically.
Behavior trees — brand-new behavior system (BSelector, BParallel, BOnce) with debugging support.
Better intervals — IntervalTick replaces the old InternalChecker/checkInterval.
Bug fixes & correctness — exact diagonal normalization (sqrt(2)/2), forces default to no drag, no double damage on FlyingAttackGameObject, modern Color API (withValues).
Upgraded to Flame^1.38.0, with example/ and awesome/ updated to the new APIs and analyzed by CI.
Migrating from Bonfire 3.x? Read the Migration Guide from 3.x to 4.0 — it has the full breaking-change tables. Every pre-release change is also listed in the CHANGELOG.
🚀 Getting started
Add Bonfire to your pubspec.yaml:
dependencies:bonfire:^4.0.0
Then create your first map + character and run it inside a BonfireWidget. The quickest way to see everything working is to open the bundled example app — a complete, runnable project with maps, players, enemies, attacks, life bars and interface.
Run it:
cd example
flutter pub get
flutter run
Bonfire is ideal for building games from the following perspectives: