oneshotlm
Compare all models on this prompt →

Asteroids · claude-opus-4.8

Output generated Cost / run $0.3049 Runtime 82.0s

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-opus-4.8
vendorAnthropic · Claude
harnesspi-agent
generated2026-07-08

METRICS

runtime82.0s
tokens in31k
tokens out7.7k
cached9.3k
cost / run$0.3049
Transcript · 8 messages
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

I'll build a complete Asteroids game in a single self-contained index.html file.

→ write /workspace/index.html (13899 bytes)
toolResult

Successfully wrote 13899 bytes to /workspace/index.html

assistant
thinking
I'm checking whether reassigning the `update` function after its declaration works in strict mode—it does, since function declarations can be reassigned even in strict mode. Let me run through the syntax to make sure everything checks out.
→ bash {"command":"cd /workspace && node --check <(sed -n '/<script>/,/<\\/script>/p' index.html | sed '1d;$d') 2>&1 | head; echo \"checked\""}
toolResult

node:fs:441 return binding.readFileUtf8(path, stringToFlags(options.flag)); ^ Error: ENOENT: no such file or directory, open '/proc/19/fd/pipe:[31961]' at Object.readFileSync (node:fs:441:20) at node:internal/main/check_syntax:36:21 { errno: -2, code: 'ENOENT', syscall: 'open', checked

assistant
→ bash {"command":"cd /workspace && sed -n '/<script>/,/<\\/script>/p' index.html | sed '1d;$d' > /tmp/g.js && node --check /tmp/g.js && echo \"SYN
toolResult

SYNTAX OK

assistant

The game is complete and syntax-checked. `index.html` is a fully self-contained Asteroids game with no external resources. Features implemented: - **Vector ship** with rotate (←/→), thrust (↑) with flame + friction, and screen wrapping - **Shooting** (Space) with cooldown, bullet limit, recoil, and lifetime - **Asteroids** as procedurally generated jagged polygons that split into two smaller pieces when hit (large → medium → small), each drifting and spinning with wraparound - **Score** (100/50/20 by size) and **lives** shown as ship icons, plus best score and level tracking - **Level progression** — clearing all asteroids spawns a harder wave - **Particle explosions** for hits and thrust, spawn invulnerability with blinking, respawn delay - **States**: title screen (with drifting asteroids), playing, pause (P), death respawn, and game over — Enter to start/restart Open `index.html` in a browser and press Enter to play.