Skip to content

Introduction

bonsai is a modular, high-performance 2D game framework written in Odin. Inspired by the simplicity of LÖVE and the low-level power of Raylib, it is designed to minimize boilerplate and maximize developer comfort.

And what does a bonsai tree need? A pot.

Pot is the project mascot and the main character of our code examples and tutorials. He spends most of his days running around, trying to find peace in his life.

Pot is indeed running.

bonsai is open-source and free forever. It is built using the Odin programming language. As “the C alternative for the Joy of Programming”, Odin is the perfect match for a developer-oriented game framework.

  • Rapid Development: Minimizes boilerplate. Exposes a fast way to share your project via web builds. Compiles instantly.
  • Fast: Built on a batched rendering pipeline with custom shader support. Runs even on a potato.
  • Comfortable: Build projects, run them and install systems with one command. Use auto-generated enums for your assets.
  • For Shipping Games: By writing modular systems, you save your coding progress. Make your own reusable toolkit that carries over to your next projects.
  • Explicit: Concise source code and clean function names help you learn quickly. Deep dive into the built-in functions with ease.

The framework’s source code lives directly inside your project folder. The “one instance per project” architecture allows you to modify, extend and tailor the framework to your needs without the fear of breaking other projects. It bridges the gap between rapid prototyping and systems-level programming.

The workflow is CLI-oriented and automated. The build pipeline handles everything from generating enums for your assets to cross-platform compilation out of the box.

This project started as a fork of this blueprint by randy, as an attempt of making it web-compatible. I learned (and borrowed some code, much love<3) from Karl Zylinski’s templates. The modular design philosophy was heavily inspired by the “Make Systems Not Games” YouTube video.