---
name: build-game
description: Build a polished, juicy, real-asset browser game from a one-line idea, to the CCC GAME STANDARD. Use when the member wants to make a game.
---

# /build-game — the CCC Game Builder

Turns "make me a game about X" into a STARFORGE-tier playable game, every time, regardless of the member's skill. Follow these steps in order. The bar is `GAME-STANDARD.md` (read it first) — do not skip any of it.

**The tools live next to this file** (in this skill's `tools/` and `template/` folders). Run them by their absolute path from this skill's own directory — NOT relative to the member's project. Below, `KIT` means the directory this SKILL.md is in.

## Step 0 — One-time setup (do automatically; the member never sees this)
The tools need Node deps. If `KIT/tools/node_modules` is missing, run once:
`cd KIT/tools && npm install && npx playwright install chromium`
(installs the asset/image libs + a headless browser for the verify harness). Node 18+ required.

## Step 1 — Lock the brief (ask only if missing)
Get three things in one quick question: **(a) the idea/mechanic, (b) the vibe/art style, (c) 2D or 3D.** Default to 2D/Phaser unless it's clearly 3D.

## Step 2 — Generate the art (the look unlock) — TIERED
Run `node KIT/tools/gen-assets.mjs <gameDir>/assets <config.json>` with a cohesive prompt set (background + main character + enemies/obstacles + items, ONE art style), sprites chroma-keyed to transparent PNGs.
- **FREE tier (default — zero setup, zero cost):** free AI art via Pollinations + Kenney CC0 packs. Every member gets real, themed game art out of the box.
- **PREMIUM tier (bespoke custom art):** the member adds a fal.ai key and runs with `ASSET_TIER=premium` → fal.ai `nano-banana-pro` for original per-game art, with automatic free fallback if it ever errors or runs out of credits.
Either tier ALWAYS yields real art — never naked shapes. That's why the look is guaranteed regardless of who's building.

## Step 3 — Scaffold from the template
Copy `template/` → the game folder. The template already has: Boot/Preload/Menu/Game/GameOver scenes, an asset loader with progress, a HUD, a juice helpers module (shake/hitstop/particles/flash/squash), a Web-Audio SFX+music helper, localStorage best-score, pixelRatio=1, and an object pool. You fill in the game's mechanic in the Game scene.

## Step 4 — Implement to the standard
First **pick the physics** (GAME-STANDARD §1): arcade ONLY for axis-aligned movement; **Matter for
anything bouncy/angled/rotating** (pinball, plinko, billiards, breakout-with-angles). If you catch
yourself hand-rolling collision/reflection on arcade, switch to Matter. With Matter, clamp ball
speed below wall thickness (no tunnelling) and drive flippers/paddles kinematically. Then wire the
mechanic using the engine's physics/collision. Apply juice everywhere (Step 3–4 of the standard)
and sound on every action. Keep it 60fps (pooling, no per-frame allocations).

## Step 5 — Verify (don't trust, check)
Run `node KIT/tools/verify.mjs <gamedir>` — it serves the folder, loads it in a real browser, fails on ANY console error, confirms the canvas renders, and saves a screenshot. Fix anything it flags. A game with console errors is not done. (This is also where the input-reliability rule in GAME-STANDARD §6b matters — confirm buttons work on a real click.)

## Step 6 — Ship
Serve it (`python3 -m http.server`) for the member to play, and give the one-command deploy. Tell them to post it as their mission.

## Reference / remix library
A worked example ships in this skill at `KIT/skills/build-game/examples/` (or `KIT/examples/`). Starting from a working game and reskinning it beats building from scratch — offer that to the member when their idea is close to an existing genre.
