# IDEA.md – a retro platform game of your own in the browser This is a self-contained brief. Give it in full to Claude Code – or to Claude Design first, for the screens – to build a game of your own. It draws on Girder Gorilla, a Donkey Kong-style platform game with a ZX Spectrum feel, designed in Claude Design and built in Claude Code. ## 1. What to build A small platform game in the browser in the style of the early arcade games, as if it were a port to a home computer from the 80s. The characters, names and levels should be your own; the style and mechanics may have a model. In Girder Gorilla: - **one level**: six sloping girders rising in steps, whole and broken ladders (broken ones can't be climbed), a platform at the top - **a villain** at the top who throws barrels at regular intervals; the barrels roll downhill, fall off the edges, sometimes take a ladder and end in an oil drum - **a hero** who walks, climbs and jumps; a fall from too high kills - **two hammers** that smash barrels for a while, but meanwhile you can't climb or jump - **scoring**: jumping a barrel, smashing a barrel and the bonus left when the level is cleared; the bonus counts down, and at zero you lose a life - **five levels** with faster and more frequent barrels, then victory - **three lives**, an extra life at 10,000, and a top 10 list with three initials ## 2. Style - **Portrait 3:4**, a world of 288 × 384 pixels scaled up with crisp pixels (`image-rendering: pixelated`). - **The ZX Spectrum palette** by default (black, blue, red, magenta, green, cyan, yellow, white) and **strict black and white** as an option. The interface colours as CSS variables, so both modes share the same layout. - **A tape loading screen** with striped borders, the Press Start 2P font and **beeper sound**: square waves in Web Audio for steps, jumps, the hammer, death and a short tune. - Game logic at a fixed rate, animation that feels like ~12 frames per second. ## 3. The way of working that worked **Design first, in a design tool.** Every screen and the flow between them (loading, title, intro, game, pause, life lost, stage clear, game over, victory, name entry, high scores), a clickable prototype, the characters as pixel maps (`#` = ink) and a **playable reference engine**. Write the specification directly to the coding agent: sizes, physics (walking speed, jump height, gravity), barrel speed per level, scoring, controls and screen flow. **The coding agent builds from the design.** Reuse the characters and the reference engine, and add what's missing: sound, high scores, scaling, mobile controls, pause. ## 4. Stack - **Plain HTML, CSS and JavaScript with no build step.** One canvas for the playfield. - **The high scores**: a small PHP API that saves to a JSON file **outside the web root**, written under an exclusive lock. Check the name (1–3 characters), the level and that the score is plausible for the level, and limit it to one score per address every ten seconds. If the server can't be reached, the list is kept in `localStorage` and shown as local. - **Shared input flags** for keyboard and touch buttons, so the same engine is driven from both. ## 5. Pitfalls - **Don't trust scores from the client.** In a browser game anyone can send a made-up score; the checks only stop the obvious. Say so plainly. - **Old files in the browser cache.** Put a version number on scripts and stylesheets and bump it on every change. - **Mobile**: the same playfield scaled to the width, with a D-pad and a jump button below; a tap in the menus is Enter. ## 6. The prompt > Build a platform game in the browser in the style of the early arcade games, as if it were a port to the [ZX Spectrum]: a villain at the top throwing barrels, sloping girders and ladders, a hero who has to rescue someone at the top, five levels, scoring, a bonus and a top 10 list. Original characters and names. Plain HTML and JavaScript with no build step, and a small [PHP] API for the high scores. > > Read all of IDEA.md below first. > > Start with the screens and a playable prototype, and show them to me before you build the rest. > > [paste IDEA.md here]