AI-first · open-source · deterministic

Point your coding agent at a game engine.

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.

Lanternway — a hayao example game
now playing Lanternway — a camera decoupled from the screen; walk the bearer across a world far larger than the viewport. Arrow keys.
28machine-verified games
485tests, green in CI
100%levels solver/bot-proven
bit-exactreplay hashes
WCAG-AApalette-gated art

Determinism is the trick that makes an AI author trustworthy: the game is a pure function of its inputs, so a solver can prove a level winnable and a replay can prove a refactor changed nothing. See the receipts & roadmap →

the one idea

The game is a pure function. The browser only watches.

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.

the store

Twenty-eight machine-verified games — start with five finished ones.

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.

Browse the full store →

build one

What your agent actually writes.

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.