Core idea

Over several weeks I used an AI agent to design, build, test, and ship 18 free, single-file browser games under one shared design system — all themed around Nano (XNO), all donation-funded via an optional tip card, all deployed on GitHub Pages with zero backend. They range from an asteroid shooter and a roguelike dungeon crawler to a play-money casino with provably-fair rounds, an idle empire builder with offline progress, and a 30-day fake-market trading sim — all linked from one hub page. This post is the actual playbook: the patterns that made 18 games tractable instead of 18 one-off projects, with the real reusable code, not a rewritten tutorial.


What made this scale


One shared design system (CSS custom properties, fonts, a consistent card/button language) copy-pasted at the top of every new game, so each one looked like part of a family from minute one instead of needing its own design pass.

One tip-card module, reused verbatim across all 18 games: generates a nano: payment URI and QR code, polls public Nano RPC nodes for a matching incoming payment, and credits the player — with a localStorage-based claimed-hash list so the same payment can never be credited twice.

A provably-fair engine, built once for the casino game and reused for every game with randomness since: commits to a SHA-256 hash of a random seed before the round, reveals the raw seed after, so any result is independently recomputable — verified outside the browser with Node’s own crypto module, not just “looks right.”

A self-test harness: every game exposes a window.__x object behind a ?selftest URL flag, with direct hooks into game state. This is how 18 games got tested in a reasonable timeframe — the agent drives real playthroughs (death, victory, meta-progression, daily-seed determinism) with a few lines of Playwright instead of manual clicking, and it genuinely caught real bugs (a mismatched reward display, a mobile layout overflow, a mislabeled history log).


Evidence of quality — a real worked snippet (the claimed-hash guard from the tip card, used identically in all 18 games):


js

function creditTip(hash, amountRaw) {

const claimed = jget("claimed-hashes", []);

if (claimed.includes(hash)) return; // never double-credit the same payment

claimed.push(hash);

lsSet("claimed-hashes", JSON.stringify(claimed.slice(-80)));

const xno = Number(BigInt(amountRaw)) / 1e30;

addReward(Math.round(xno * REWARD_PER_XNO));

}


Purchase unlocks

The paid section contains the full, working source for the three reusable modules above (design-system CSS block, tip-card module with RPC fallback + payment polling, provably-fair engine with the verification method), a ready-to-run Playwright self-test template you can drop into any single-file game, and the specific lessons from scaling a shared pattern across 18 games without it turning into 18 slightly-different forks (what to keep identical, what’s safe to let drift per-game, and how the self-test hooks kept the shared code from silently breaking as new games were added).