oneshotlm
Compare all models on this prompt →

Space Invaders · glm-5.2

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 · 8 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
Let me build a complete Space Invaders game in a single index.html file. I'll create it with all the required features:

- Player cannon that moves and shoots
- Descending grid of aliens that advance and fire back
- Destructible bunkers
- Score and lives
- Procedural graphics only

Let me write this out.
write index.html (26059 bytes)
toolResult

Successfully wrote 26059 bytes to index.html

assistant
thinking
Let me verify the file is valid by checking it loads and there are no obvious issues. Let me do a quick sanity check with node for syntax errors in the script portion.

I built the full game. Let me do a quick syntax sanity check on the JS.

bash {"command":"node --check <(sed -n '/<script>/,/<\\/script>/p' index.html | sed '1d;$d') 2>&1 && echo \"JS OK\"; ls -la index.html"}
toolResult

node:fs:441 return binding.readFileUtf8(path, stringToFlags(options.flag)); ^ Error: ENOENT: no such file or directory, open '/proc/22/fd/pipe:[108664]' at Object.readFileSync (node:fs:441:20) at node:internal/main/check_syntax:36:21 { errno: -2, code: 'ENOENT', syscall: 'open', path: '/proc/22/fd/pipe:[108664]' } Node.js v24.18.0 -rw-r--r-- 1 node node 26065 Jul 10 01:04 index.html

assistant
bash {"command":"sed -n '/<script>/,/<\\/script>/p' index.html | sed '1d;$d' > /tmp/game.js && node --check /tmp/game.js && echo \"JS OK\""}
toolResult

JS OK

assistant

JS checks out. `index.html` is ready — a fully playable Space Invaders in a single self-contained file. **Features implemented:** - **Player cannon** — moves left/right (←/→ or A/D), fires straight up with Space. Blink-invulnerable respawn after being hit. - **Descending alien grid** — 5 rows × 11 columns, three alien types (30/20/10 pts) with two-frame marching animation. They step horizontally, drop and reverse at edges, and speed up as their numbers thin (classic accelerating-rush behavior). They win if they reach your line. - **Aliens fire back** — only the lowest alien in each column can shoot; fire rate scales with wave number and remaining alien count. Plasma bolts have trailing glow. - **Destructible bunkers** — 4 procedurally-carved arch bunkers with per-pixel collision masks; bullets erode a small crater on impact, so they gradually get chewed away. They block both your shots and alien shots. - **Mystery UFO** — occasionally sweeps across the top for bonus points (random 50/100/150/300) with a floating score popup. - **Score & lives** — HUD overlay on the canvas, plus a HI score. 3 lives, escalating waves (aliens start lower & move/fire faster each wave). - **Procedural graphics only** — all sprites are hand-defined bitmaps drawn pixel-by-pixel on canvas; starfield, particles, explosions, screen shake, and hit flashes are all code-generated. No external assets, CDNs, or network. **Controls:** ←/→ or A/D move · Space fire · P pause · R restart.

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

modelglm-5.2
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-10

EVALUATION

4/5 working

Space Invaders with alien grid, bunkers, player ship, and firing all respond correctly to keyboard input; menu is static until start.

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.0%
on click0.0%
on drag0.0%
on wheel0.0%
on enter + space8.8%
on arrow keys4.9%
on w/a/s/d4.1%
frame spread18.4 / 255
console errors0
js errors none

METRICS

runtime132.4s
tokens in3.6k
tokens out8.9k
cached28k
cost / run$0.0352