oneshotlm
Compare all models on this prompt →

Space Invaders · laguna-xs-2.1

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 · 6 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 me to build a complete Space Invaders game in a single HTML file with inline CSS and JavaScript. Let me plan this out:

1. HTML structure with a canvas element
2. CSS for styling
3. JavaScript for the game logic

Key features to implement:
- Player cannon that moves left/right and shoots
- Descending grid of aliens that advance and can shoot
- Destructible bunkers
- Score and lives display
- Procedural graphics (no external images)

I'll create a comprehensive game with all these elements. Let me write the full implementation.
write /tmp/ws/index.html (19225 bytes)
toolResult

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

assistant
thinking
I've created a complete Space Invaders game in a single HTML file. Let me verify it's there and then summarize what was created.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 19225 Aug 2 03:25 /tmp/ws/index.html

assistant
thinking
The file has been created successfully. Let me verify its contents to make sure everything is in order.

The Space Invaders game has been built and saved to `/tmp/ws/index.html`. Here's what's included: **Features:** - **Player cannon** - Moves left/right with arrow keys, shoots with Space - **Alien grid** - 5 rows of 11 aliens that move horizontally and descend when hitting edges - **Alien shooting** - Random aliens fire back at the player - **Destructible bunkers** - 3 bunkers made of block grids that can be destroyed by both bullets and alien fire - **Score system** - Points based on alien type (10/20/30 points for red/green/blue aliens) - **Lives system** - 3 lives, loses one when hit by alien bullet - **Level progression** - Speed increases each level, aliens respawn - **Explosions** - Visual feedback when enemies explode or bunkers are hit - **Game over** - Shows score when player loses all lives **Gameplay:** - Arrow keys: Move left/right - Space: Shoot - Enter: Start/Restart All graphics are procedural - the player cannon, alien saucers with antennae, bunkers, and bullets are drawn with canvas primitives (rectangles, arcs, lines). No external assets or network requests needed.

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

modellaguna-xs-2.1
vendorpoolside
harnesspi-agent
generated2026-08-02

EVALUATION

4/5 working

Space Invaders with colored alien rows, bunkers, cannon, and enemy fire appear once game starts via keyboard input.

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 + space2.3%
on arrow keys2.9%
on w/a/s/d2.9%
frame spread12.7 / 255
console errors0
js errors none

METRICS

runtime31.8s
tokens in15k
tokens out5.6k
cached10.0k
cost / run$0.0013