Hayao is an open-source 2D engine built for the age of coding agents. Tell Claude or Codex what to make, and get back a real game — one that runs the same every time, proves its own levels winnable, and plays in your browser. The next Godot, authored by an AI instead of a GUI.
Make a Sokoban with 20 solver-proven levels. Build with the npm package hayao.
Paste it into your agent. Everything on this page was authored this way — no engine GUI, no binary scenes.
state₀ → step(inputs) → state₁ → step(inputs) → state₂ → …
Rendering, audio, and the DOM are observer plugins. They paint what the function produces; they can never change its result.
Hold that invariant and every hard problem for an AI author collapses. “Does it work?” — world.step() runs in
Node; assert on state, no pixels. “Is this level winnable?” — the transition is pure, so a search proves it. “Did my
refactor break anything?” — replay the inputs, compare world.hash(). Godot's authoring model is excellent, so hayao
borrows it wholesale — nodes, scenes, cameras, tweens — but makes every part text, typed, greppable, and headlessly verifiable, so an
agent can drive it.
Most engines demo a slice — some particles, a physics box. Hayao ships whole games, because a whole game is the proof the engine is complete. These five are art-finished in the house woodblock style; the rest are playable engine slices you can read and fork.
A Camera2D follows the bearer across a world that dwarfs the screen — the smooth follow is cosmetic, so it never touches the hash.
Three counter-typed towers on a sunlit lane, ten ramping waves — the winning build is proven, and arrow-spam is proven to lose to tanks.
Every roof scores by its neighbours, live under the cursor — placement skill is proven to nearly double random play.
A paper lantern drifts a night river to the dawn sea — the renderer's gradient, glow, and parallax leap, cosmetic so the lush view never touches the hash.
A sunlit smallholding — tilled furrows, watered soil, crops that swell to ripe, a straw-hatted farmer. The festival goal is proven reachable; reinvestment compounds.
A game is one folder under examples/<slug>/ that imports only from @hayao and calls
defineGame(). Turn-based rules live in a pure module a solver can prove; the scene tree is just the view. Your agent copies
examples/sokoban/, follows the docs and
AGENTS.md, and runs npm test — headless, in Node —
to know it works before a browser ever opens. Honest about today: the three featured games above are the current art bar; an
Ori-scale metroidvania out of the box is on the roadmap, not yet in the box.