A 2D game framework for writing games with Ruby. More batteries than a fantasy console, less than an engine.
See DOCS.md for the full API reference.
Make a directory with a main.rb:
g.target = resolution/2
def update
quit if pressed?(:escape)
g.target = g.target.move_toward(mouse, 50*dt)
end
def draw
rect(v2(16)).draw(offset: g.target - v2(8), filled: true, color: P.blue)
circ(5).draw(offset: mouse, filled: true, color: P.yellow)
endDownload latest release, put it in PATH. I have no idea if any of this works on Windows and I provide no consideration whatsoever for that case, so sorry.
mini9 path/to/mygamemini9 package --source path/to/mygame --output .
mini9 mygame.m9# builds ./mygame dir containing index.html, cart, etc
mini9 package --web --source path/to/mygame --output .
# zip for itch.io or similar
zip -r mygame.zip mygameodin2026-05ruby3.4+git,cmake,make,cc,bison,python3- on Linux:
libgl1-mesa-dev libx11-dev libxrandr-dev libxinerama-dev libxi-dev libxcursor-dev libxkbcommon-dev,libwayland-dev wayland-protocols
bin/build setupbin/build debugbin/build debug --web path/to/mygame