oneshotlm
Compare all models on this prompt →

Space Invaders · qwen3.7-flash

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 · 10 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
The user wants a complete Space Invaders game in a single HTML file. Let me build this with:

1. Canvas-based rendering
2. Player cannon (movable, shoots)
3. Grid of aliens that descend and advance
4. Destructible bunkers
5. Score and lives tracking
6. Procedural graphics (drawn with canvas primitives)
7. No external resources

Let me design the game mechanics:
- Player moves left/right with arrow keys, shoots with space
- Aliens move in formation, shift direction when hitting edges, then drop down
- Aliens randomly fire back
- 4 bunkers that degrade as they take hits
- Score for killing aliens, bonus for UFO (optional extra)
- Lives system

I'll draw everything procedurally using canvas paths and rects. Let me make it look good with pixel-art style sprites drawn programmatically.
write /tmp/ws/index.html (23945 bytes)
toolResult

Successfully wrote 23945 bytes to /tmp/ws/index.html

assistant
thinking
I notice I have a bug - the `Sprites` function references itself. Let me fix that and also clean up a few things.
edit {"path":"/tmp/ws/index.html","edits":[{"oldText":" let spriteKey = 'alien' + a.type;\n // Alternate animation frame subtly by shifting r
toolResult

Successfully replaced 2 block(s) in /tmp/ws/index.html.

assistant
thinking
Now let me verify the file looks correct by checking a few key sections.
bash {"command":"wc -l /tmp/ws/index.html && head -5 /tmp/ws/index.html && echo \"---\" && tail -5 /tmp/ws/index.html"}
toolResult

881 /tmp/ws/index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> --- initStars(); requestAnimationFrame(gameLoop); </script> </body> </html>

assistant
thinking
The file is complete. Let me verify the code is syntactically sound by checking for any obvious issues with grep for common problems.
bash {"command":"cd /tmp/ws && node -e \"try { new URL('file:///tmp/ws/index.html'); const fs = require('fs'); const html = fs.readFileSync('inde
toolResult

File size: 23720 bytes --- 1 1 1 1

assistant
thinking
The file is complete and well-formed. Let me provide a summary to the user.

Done! **`/tmp/ws/index.html`** — a fully playable Space Invaders game, self-contained in one HTML file (~24KB). No external resources or network requests needed. ### Features - **Player cannon** — moves with Arrow keys or WASD, fires with Space - **5 rows of aliens** (squid, crab, octopus) that shift direction at edges, descend, and speed up as fewer remain - **3 alien types** with different colors & point values: Squid (10-30pts), Crab (20pts), Octopus (10pts) - **Mystery UFO** — randomly flies across the top for bonus points (50–300) - **4 destructible bunkers** made of individual segments that chip away from both bullet types - **Score, lives display, level progression** (5 levels with increasing difficulty), and high score saved to localStorage - **Procedural sound effects** via Web Audio API (shoot, explosions, alien steps, player hit, level up, UFO beep) - **Particle explosions**, twinkling star field background, floating score text - **Menu → Play → Game Over / Win states** with replay support

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

modelqwen3.7-flash
vendorQwen
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Fully functional Space Invaders with menu, alien grid, bunkers, player ship, score/lives HUD, and keyboard controls all working.

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 click0.6%
on drag0.6%
on wheel0.6%
on enter + space13.1%
on arrow keys7.9%
on w/a/s/d6.2%
frame spread35.8 / 255
console errors0
js errors none

METRICS

runtime67.2s
tokens in28k
tokens out10k
cached20k
cost / run$0.0023