oneshotlm
Compare all models on this prompt →

Space Invaders · glm-4.5

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 Space Invaders game in a single HTML file. This should include:
1. A player cannon that moves left/right and shoots
2. A grid of aliens that descend and move side-to-side, firing back at the player
3. Destructible bunkers that can be damaged by both player and alien fire
4. Score tracking
5. Lives tracking
6. All procedural graphics (no external images)
7. All in a single index.html file with CSS and JS inline

Let me create a complete, playable Space Invaders clone.

I'll create a complete Space Invaders game in a single HTML file with all the features you requested.

write /tmp/ws/index.html (25055 bytes)
toolResult

Successfully wrote 25055 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 was created correctly.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 25059 Aug 1 20:51 /tmp/ws/index.html

assistant
thinking
I've created a complete Space Invaders game with all the requested features. Let me summarize what I built:

1. **Player cannon** - Moves left/right with arrow keys or A/D, shoots with spacebar
2. **Aliens** - 5 rows × 11 columns of procedurally drawn pixel-art aliens that descend and move side-to-side
3. **Destructible bunkers** - 4 bunkers with arch shapes that can be damaged by both player and alien bullets
4. **Score system** - Different alien types give different points (10, 20, 30), plus a UFO that appears randomly for bonus points
5. **Lives system** - Player starts with 3 lives
6. **Procedural graphics** - All graphics are drawn using canvas primitives (rectangles, arcs) with pixel-art patterns for aliens
7. **Additional features**:
   - UFO that randomly appears for bonus points (50-300)
   - Explosion effects
   - Star background
   - High score saved to localStorage
   - Pause functionality (P key)
   - Multiple levels with increasing difficulty
   - Start screen and game over screen
   - Alien speed increases as fewer aliens remain

The game is fully self-contained with no external resources.

I've created a complete, self-contained Space Invaders game in `index.html`. Here's what's included: **Gameplay Features:** - **Player cannon** - Move with ← → or A/D keys, shoot with SPACE - **5 rows × 11 columns of aliens** - 3 different alien types with pixel-art patterns (worth 10, 20, 30 points) - **Aliens descend and advance** - They move side-to-side and drop down when reaching edges - **Aliens fire back** - Random shooting that increases as more aliens are destroyed - **4 destructible bunkers** - Arch-shaped barriers that degrade when hit (3 hits to destroy a block) - **UFO bonus** - Random flying saucer appears for 50-300 bonus points **Game Systems:** - **Score tracking** - Points for different alien types - **High score** - Saved to localStorage - **Lives** - Start with 3 lives - **Levels** - Wave completion with increasing difficulty - **Pause** - Press P to pause/resume **Visual Effects:** - Procedural pixel-art aliens with different colors and patterns - Explosion particles when aliens/player are hit - Twinkling star background - Glowing bullets - Bunker damage visualization (fades as damaged) **Screens:** - Start screen with instructions - Game over screen with final score - Pause overlay The game runs entirely offline with no external dependencies - all graphics are drawn procedurally on the canvas.

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-4.5
vendorZ.ai · GLM
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Fully functional Space Invaders with aliens, bunkers, projectiles, score/lives; starts paused until keyboard input triggers gameplay.

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 + space5.9%
on arrow keys8.2%
on w/a/s/d0.0%
frame spread20.7 / 255
console errors0
js errors none

METRICS

runtime100.0s
tokens in17k
tokens out6.8k
cached10k
cost / run$0.0202