Box2D Physics for Flutter

Craig Oda
2 min readJul 3, 2022
Flutter game with Box2D physics using Forge2D

Box2D is a famous physics engine for games. It is used in Crayon Physics Deluxe, Limbo, Rolando, Incredibots, Angry Birds, Tiny Wings, Shovel Knight, Transformice, Happy Wheels and many more games.

The three tutorials below in the free playlist Forge2D — Flame 1.2 will walk you through using the Dart port of Box2D, called Forge2D,with your next Flutter game.

01. Box2D Game Physics for Flutter

  • installing Flutter packages needed to use Box2D
  • start with a completely blank editor screen and build up from zero code
  • introduces primary concepts of body, world, fixture as well as parameters such as gravity, friction, restitution, and density
introduction to Box2D

02. Flutter Sprites and Box2D Physics

Explains how to attach sprites to the Box2D bodies using the flame_forge2d BodyComponent.

03. Flutter Box2D Towers with Flame

Create and knock down small towers made from stacked barrels and crates.

Different Game Plots

Code Baker One is building a plot based on dinosaurs using fan art from Like a Dino!

Dinosaur concept for Flutter game. Graphics are from “Like a Dino!” game by super_toki

The free playlist has the full code for the tutorial as well as a step-by-step walkthrough.

--

--

Craig Oda

open source advocate, writer, Flutter developer, father, husband, fly fisherman, surfer