Give your AI Agent
a Game Engine

You have the game idea — now your AI can build it. Free & open source.

> npm i hayao

Show, don't tell

Prompt a real game. Watch it change.

This platformer runs on hayao, live on this page. Each prompt makes the kind of multi-system edit your agent makes — mechanics, art, sound and HUD in one go. Stack them.

hayao · agent
This platformer runs on hayao right here. Click a prompt — I'll edit the live game.
import { runBrowser } from 'hayao'

Assets, made by AI

Every asset is code — so your agent can author all of it

An AI can't paint a PNG or record a sound — but it can write vectors, palettes, and synthesis. In Hayao, art and audio are programs: reviewable in a diff, tweakable by prompt, and always crisp.

Vector sprites

Characters & props drawn from shapes — no sprite sheets to source.

Palettes

Curated, contrast-checked colour systems the whole game inherits.

Textures & autotile

Procedural surfaces and tiles that seam themselves.

Bitmap fonts

Pixel type defined in code, rendered crisp at any scale.

Particles & juice

Hit-stop, shake, bursts — feel as declarative recipes.

Procedural audio

Synthesised SFX and music — no samples, just parameters.

Why not just…

What an agent needs that other engines don't give it

Godot, GameMaker, LittleJS and Phaser are excellent at what they were built for — human-driven workflows. This table scores one thing only: how well an autonomous agent can drive them.

CapabilityHayaoGodotGameMakerLittleJSPhaser
Plain-code authoring, no editor required
Simulation runs headless in Node~
Deterministic by default
Solver-provable levels & replay hashes
Agent-readable playtests (Workshop + MCP)
Free & open source (MIT)

~ = possible with care, not a design goal.

How it works

AI-native, deterministic, and made of nodes

Built for the machine that writes the game

Traditional engines assume a human clicking through an editor — GUIs, binary scenes, a bespoke language. Hayao keeps Godot's proven authoring model but makes every parttext, typed and greppable: the whole game is code your AI can write, read back, and reason about.

The game is a pure function of its inputs

Every frame is state → step(inputs) → state. All randomness flows through one seeded RNG; no wall-clock, no hidden state. Same inputs, same result — bit for bit, on any machine.

const w = createWorld(game);
w.step(['right']);   // advance one tick
w.step([]);          // release

w.probe().solved;    // assert on STATE
const h = w.hash(); // replay → same hash

Godot's scene tree, in plain code

Compose the game from nodes — Node2D, Sprite, Camera2D, Timer, AnimationPlayer — a tree you build in TypeScript, not a binary you edit in a GUI. Rendering is a projection of that tree, so the simulation never needs a canvas.

World
└─ Node2D player
   ├─ Sprite body
   ├─ Camera2D follow
   ├─ AnimationPlayer run
   └─ Timer coyote

Prove it works

Run in Node, assert on state. No browser, no pixels, no flakiness.

Prove it's winnable

step() is a pure transition, so a solver can search every level to the end.

Refactor without fear

Replay the input log, compare the hash. Identical, or it's a regression.

Time-travel & undo

snapshot() and restore() any tick. Undo and save-states fall out for free.

Replays & scrubbing

A whole session is just its input log — jump to any moment and re-simulate.

Rollback multiplayer

Determinism is exactly what makes lockstep and rollback netcode possible.

Open source · MIT

Yours to jam with.

Hayao is MIT-licensed — free for commercial and personal projects alike. No seats, no royalties, no strings. Build your jam entry, your prototype, or your next release on it.

Star on GitHub
> npm i hayao