Skip to content
pubscout

flame_forge2d

0.20.0, released 3 months ago by flame-engine.org

Forge2D physics engine support and wrappers for the Flame game engine.

WASM-ready
$ flutter pub add flame_forge2d
Source repository

What it does

Acts as a bridge between the Forge2D (Box2D) physics library and the Flame game engine. It provides wrappers, components, and world management to build physics-based 2D games inside Flutter.

AI-written summary of version 0.20.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a 2D game using the Flame engine that requires rigid body physics.
  • You want to utilize Box2D/Forge2D physics simulations inside your Flame game loop.

Skip it when

  • You are not using the Flame game engine for your project.
  • Your game does not require complex physics simulations and simple custom movement is enough.

Strengths

  • Seamless integration between Flame and Forge2D.
  • Handles physics calculations, collision detection, and gravity natively for Flame components.

Weaknesses

  • API changes can be significant when underlying Box2D/Forge2D versions update (such as v3 changes in 0.20.0).
  • Requires learning both Flame and Forge2D concepts.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Add flame_forge2d and flame to your pubspec.yaml file.

import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame/game.dart';

class MyGame extends Forge2DGame {
  @override
  Future<void> onLoad() async {
    await super.onLoad();
  }
}

Alternatives

Packages that do the same job and could replace flame_forge2d.

  • flutter_scene

    A 3D game engine for Flutter built on Flutter GPU with PBR lighting and glTF support.

  • bonfire

    Create RPG-style games and similar 2D games using Flame engine.

  • just_game_engine

    A 2D and 3D game engine for Flutter featuring ECS, physics, audio, and level maps.

  • jenny

    YarnSpinner narrative game tools equivalent for Dart and Flame.

Works with

Packages commonly used together with flame_forge2d: ones it builds on, ones built on it, and its own family.