oneshotlm
Compare all models on this prompt →

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.

⛨ sandboxed Open in new tab ↗
transcript · 4 messages
user

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.

assistant
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.

write index.html (6651 bytes)
toolResult

Successfully wrote 6651 bytes to index.html

assistant

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

modelgpt-oss-120b
vendorOpenAI
harnesspi-agent
generated2026-07-22

EVALUATION

2/5 partial

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.

idle motion0.6%
on click4.2%
on drag0.0%
on wheel0.0%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread11.5 / 255
console errors0
js errors none

METRICS

runtime57.5s
tokens in5.0k
tokens out2.6k
cached0
cost / run$0.0007