Space Invaders · gpt-oss-120b
Build a playable Space Invaders game on a canvas: a player cannon that moves and shoots, a descending grid of aliens that advance and fire back, destructible bunkers, score, and lives. Procedural graphics only, no external assets.
transcript · 4 messages
Build a playable Space Invaders game on a canvas: a player cannon that moves and shoots, a descending grid of aliens that advance and fire back, destructible bunkers, score, and lives. Procedural graphics only, no external assets.
thinking
We need to create a single-file self-contained index.html with a playable Space Invaders game using canvas, procedural graphics (draw shapes). Must be all in one file, no external resources. We'll write HTML skeleton with canvas, style to fill center, script implementing game. Should handle player, aliens, bullets, bunkers, score/lives display. We need to generate the file. We'll just write it. Make sure the file is written as index.html. Will use requestAnimationFrame for loop. Implement simple game: Constants: canvas width, height. Player: width 40, height 20, x centered bottom, speed. Aliens: rows 5, cols 11, each 30x20, spacing, start at top. Aliens move as group: direction = 1 (right), step every interval, drop down when hitting edge. Aliens fire randomly: each frame probability to fire per alien. Bullets: player bullet (single) moving up, alien bullets (multiple) moving down. Bunkers: maybe 4 bunkers, each consisting of small rectangles. Collision detection. Score and lives displayed via context fillText. Game over on lives 0, display Restart. We'll write code succinctly. Let's write file content.
index.html (6651 bytes)Successfully wrote 6651 bytes to index.html
The **Space Invaders** game has been created as a single self‑contained HTML file named `index.html`. It includes all required CSS and JavaScript directly within the file, uses only procedural canvas drawing, and runs entirely offline without external assets. Open `index.html` in a browser to play.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
EVALUATION
Aliens descend and bunkers render, but a single click triggers instant Game Over with lives 0, and keys never restart the game.
Vision grade · anthropic/claude-sonnet-5
MEASUREMENTS
Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.