Skip to content

bonsai…

The lightweight, web-ready 2D game framework written in Odin.

Designed for clarity.

Minimal boilerplate, maximum focus on logic.

game.odin
package game
import "bonsai:core/gmath"
import "bonsai:core/render"
draw :: proc() {
position := gmath.Vector2{0, 0}
render.drawSprite(position, .potSprite)
}
Result
Pot Sprite

Install new systems instantly using the Rust CLI.

Install user-created physics, networking or pathfinding with a single command.

bonsai-cli
$ bonsai install nihiL7331/physics
[05:02:35] Installing system 'physics'...
[05:02:36] Auto-generating manifest for system: 'physics'
[05:02:36] ✔ Installed physics successfully.
$ _

Automatic enum generation from file names.

Why waste time writing boilerplate? Let Pot handle this.

assets/images/
  • > pot.png
  • > pot_run.png
  • > pot_crawl.png
  • > pot_beg.png NEW
Auto-Generated
generated_sprite.odin
package game_types

SpriteName :: enum {
pot,
pot_run,
pot_crawl,
pot_beg,// Added!
}

Stop Tinkering. Start Shipping.

A framework designed to help you deliver your dream game.

Dev-First Comfort

bonsai comes batteries-included. Minimal boilerplate and many helper functions so you can focus on game logic.

Instant Web Distribution

Build to web via Emscripten in seconds and send a link. No friction, faster beta testing.

Opinionated Structure

A scalable folder structure ensures your project grows without turning into spaghetti.

Minimal Core

Take what you need. The core is tiny (but capable), the rest is modular. One CLI command gets you what you need.

Rust-Powered CLI

Initialize projects, install systems and build to targeted platforms in seconds using the CLI.

Scriptable Pipeline

Extend your build process. Write build-time scripts in Python, Rust or Odin to automate custom asset processing seamlessly.

Low-Level Control, High-Level Comfort with Odin

Write gameplay code in Odin. Enjoy modern syntax, distinct types and context-aware allocators with C performance.

Truly Yours

bonsai is under the MIT license. There's no hidden fees, no royalties. Whatever you make is yours to keep.

Built and maintained by Patryk Pujanek.