oneshotlm
Compare all models on this prompt →

Asteroids · claude-sonnet-5.5

Output generated Cost / run $0.0750 Runtime 33.6s

Prompt for this run

Build a playable Asteroids game on a canvas: a thrust-and-rotate vector ship that shoots and wraps around the screen edges, splitting asteroids into smaller pieces, with score and lives. Procedural vector graphics only, no external assets.

⛨ sandboxed Open in new tab ↗

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

modelclaude-sonnet-5.5
vendorAnthropic · Claude
harnesspi 0.87.1 · browser iteration
generated2026-10-05

METRICS

runtime33.6s
tokens in22k
tokens out4.4k
cached9.8k
cost / run$0.0750
Transcript · 9 messages
system

user

Build a playable Asteroids game on a canvas: a thrust-and-rotate vector ship that shoots and wraps around the screen edges, splitting asteroids into smaller pieces, with score and lives. Procedural vector graphics only, no external assets.

assistant
→ write /tmp/job-yrUQJn/index.html (5844 bytes)
→ browser {"action":"reload"}
toolResult

Successfully wrote to /tmp/job-yrUQJn/index.html

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"","images":"attached"}

assistant

Title works. Quick play test.

→ browser {"action":"key","text":"Enter"}
→ browser {"action":"screenshot"}
toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"","images":"attached"}

toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"","images":"attached"}

assistant
thinking
The rock count checks out for level 1, and the function reference looks fine too. I'm fairly confident this is ready to ship.

The Asteroids game is built in `/tmp/job-yrUQJn/index.html`. I only checked the title screen and the start of a game by screenshot. I didn't test shooting, splitting, scoring, collisions, game over or the level-clear message, so those are untested. The title screen shows drifting asteroids. Pressing Enter starts a game with the ship at the centre, 3 lives and 4 large asteroids. The browser console showed only a sandbox warning from the preview iframe and no script errors. **Controls:** left and right arrows (or A and D) rotate, up arrow (or W) thrusts, Space fires, and Enter starts or restarts. **Rules:** - **Ship and shots:** the ship and its bullets wrap around the screen edges. - **Asteroids:** large ones split into two medium, then two small. Scores are 20 for a large asteroid, 50 for a medium and 100 for a small. - **Lives:** the ship is invulnerable for a few seconds after each respawn. You get an extra life every 5,000 points. - **Levels and score:** clearing all asteroids starts a new level with one more asteroid. The high score is kept in `localStorage`. Everything is drawn procedurally as glowing vector lines, with no external assets.