Codex game development

Codex For Game Development

Codex App ships with image generation built in — perfect for game work — but a green build doesn't mean a working game. The pack pairs Codex with skills that keep the canvas honest.

I used Codex App as the spine of the Pirate Survival Beat 'Em Up tutorial because it has image generation built in. No API key juggling for the asset pipeline. The whole brawler — animated combat, music, screen shake, Fibonacci difficulty ramp — shipped in 17 focused prompts from a blank Phaser 4 starter.

The catch with Codex on games is drift. Give it a huge ambiguous task and the output gets generic fast. The fix is bounding every request to a file group and a verification step, and loading playwright-testing so Codex can actually see what it built instead of trusting that the build passed.

Why It Matters

  • Forest Census — public Three.js mini-game shipped with Codex CLI and the threejs-builder skill
  • The exact 17-prompt sequence behind the Pirate Survival Beat 'Em Up tutorial
  • playwright-testing skill for canvas/WebGL verification — Codex's blind-spot fix

Workflow

Give Codex a repo-shaped task

'Add jump logic to PlayerController.ts and verify the player leaves the ground' is a Codex task. 'Build a platformer' isn't. Name the file, the mechanic, the visible check — every time.

Load playwright-testing for canvas work

A passing build with a blank canvas looks identical to a working game from the terminal. The playwright-testing skill teaches Codex how to take a screenshot and verify the canvas isn't black before claiming the task is done.

Iterate — don't 'try again'

When something breaks, ask Codex to fix that specific thing. Avoid 'try a different approach' — that's how you lose two hours rewriting code that was almost working.

Public Vault Excerpts

Project

Forest Census

A small Three.js counting game built with Codex CLI and the threejs-builder skill. It is the cleanest public example of using Codex for a scoped, playable web game instead of asking for an entire game at once.

  • Codex
  • Three.js
  • Static hosting
Open public resource

Agent skill

threejs-builder

The skill gives Codex the scene/camera/renderer setup, animation loop, resize handling, asset-loading, and performance defaults it needs before generating game code.

  • Skill file
  • 3D
  • Repo context

Agent skill

playwright-testing

A testing workflow for frontend and game projects, including visual checks and canvas/WebGL verification. Codex gets much better when it can prove the game is visible and interactive.

  • Testing
  • Canvas
  • Verification

Prompt Patterns

Bound the task to a file

Read the current structure first. Implement [one mechanic] in the smallest reasonable file set — name them before you start. Preserve current controls. End with a browser screenshot or short interaction test so I can confirm the canvas isn't blank.

Frequently Asked Questions

Can Codex actually ship a game?

Yes, with the right shape of prompt. The Pirate Beat 'Em Up tutorial is a full 17-prompt build with Codex App from blank starter to playable brawler. Forest Census is the smaller Codex CLI example — a tiny Three.js counting game built one verb at a time. Codex shines when the scope is bounded; it falls apart on 'make me a roguelike.'

Is this just for browser games?

No, but indie-scale browser games are the sweet spot. The skills cover Phaser, Three.js, Love2D, and Capacitor iOS deployment. Once a project gets past ~10k lines you're in territory where Claude Code's broader context window starts to matter more.

Why not just use Codex with the docs?

Because the docs don't tell Codex that a Phaser scene has a preload phase, or that a canvas game needs a screenshot check, or that this specific repo uses Arcade physics instead of Matter. The skill files are the missing operating manual, and the source repos are the working examples Codex imitates.