Back to blog
AI Claude Code Game Dev Pixel Art

I Had Claude Build a Mega Man Game

Every pixel and every note generated from code. Nine stages, eight weapons, playable in your browser.

I asked Claude for an original Mega Man X-style game. Not a tutorial clone with downloaded sprites — everything made from scratch. It's playable here, in the browser.

There are no assets in the usual sense. Every sprite is an ASCII grid in a Python file where each character is a palette colour, rendered to PNG by a build script. The level is a text file, one character per tile. The soundtrack was written as note tables and rendered through an emulated NES sound chip: four monophonic voices, envelopes stepping at 60 Hz, and the echo composed as a second voice because the real hardware had no reverb. The whole game is about 12 MB compressed, and roughly half of that is the engine.

The interesting part was the feedback loop. I couldn't hear the music or feel the jump physics, so Claude built itself instruments instead: a bot that plays the level start to finish and fails the build if it can't reach the boss, a screenshot rig, a check that no enemy sprite shares a colour with the background, and a test that fails if text drifts off its baseline. Most of the bugs I reported in plain English — "the little bees hover too low to shoot", "his body doesn't disappear when he dies" — turned into a permanent test.

When I first posted this it was one stage, about four minutes, ending at a boss-select screen for stages that didn't exist yet.

Update, September 4: it's the whole game now. Eight Maverick stages you can take in any order — a volcanic foundry, cryo fields, a deep reactor, a sky fortress, an overgrown dam, a scrap desert, a sunken harbor and a faultline mine — each with its own tileset, backgrounds, enemies, boss, weapon and song; a weakness cycle between the eight weapons; and a fortress at the end with a boss rush and a two-form final boss. Still every pixel from code: the master palette grew from 72 colours to 160, one ramp per theme, and the same bot now plays all nine stages and fights every boss before a build passes. Arrows to move, X to jump, C to shoot, Z to dash, Q and E to change weapons.