oneshotlm
Compare all models on this prompt →

Asteroids · glm-4.7-flash

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 ↗
transcript · 4 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
thinking
The user wants me to build a playable Asteroids game in a single HTML file. Let me plan out the components:

1. HTML structure with a canvas
2. CSS for styling
3. JavaScript for the game logic including:
   - Vector ship that can thrust and rotate
   - Shooting mechanics
   - Screen wrapping
   - Asteroids that split into smaller pieces
   - Score and lives system
   - Procedural vector graphics (no images)

Key game mechanics:
- Ship rotation (left/right arrows)
- Thrust (up arrow) - shows thrust particles
- Shoot (spacebar)
- Asteroids spawn and drift
- Collision detection
- Asteroids split when hit
- Lives system
- Game over screen

Let me create a comprehensive single-file implementation.

I'll create a complete Asteroids game in a single HTML file with all the game mechanics.

write /workspace/index.html (17330 bytes)
toolResult

Successfully wrote 17330 bytes to /workspace/index.html

assistant
thinking
I've created a complete Asteroids game in a single HTML file. Let me verify the key features:

1. ✅ Vector ship that thrusts and rotates
2. ✅ Shooting mechanics
3. ✅ Screen wrapping for ship, bullets, and asteroids
4. ✅ Asteroids split into smaller pieces
5. ✅ Score tracking
6. ✅ Lives system (3 lives)
7. ✅ Procedural vector graphics (no external assets)
8. ✅ Game over screen with restart
9. ✅ Invincibility after respawn
10. ✅ Thrust particles
11. ✅ Explosion particles

The game is fully self-contained with inline CSS and JavaScript, runs without external resources, and includes all the classic Asteroids gameplay mechanics.

I've created a complete, playable Asteroids game in a single HTML file. Here's what's included: **Gameplay Features:** - **Vector ship** with smooth thrust and rotation mechanics - **Screen wrapping** for ship, bullets, and asteroids - **Shooting** with a limited number of bullets (5 on screen) - **Asteroid splitting** - large asteroids split into 2 medium, medium into 2 small - **Score system** - 20 points for large, 50 for medium, 100 for small asteroids - **Lives system** - 3 lives with temporary invincibility after respawn **Visual Effects:** - Procedural vector graphics (no images) - Thrust flames that animate - Orange/yellow thrust particles - White explosion particles when asteroids/ship are destroyed - Starfield background **Controls:** - Arrow keys or WASD for movement - Spacebar to shoot - Click "Play Again" to restart after game over The game runs fully sandboxed with no external dependencies or network requests. Enjoy!

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.7-flash
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-10

EVALUATION

3/5 working

Asteroids game renders with ship, drifting asteroids, lives lost quickly, and game over screen with Play Again.

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 motion1.5%
on click1.9%
on drag1.8%
on wheel1.9%
on enter + space1.9%
on arrow keys1.9%
on w/a/s/d4.0%
frame spread10.4 / 255
console errors0
js errors none

METRICS

runtime47.5s
tokens in139
tokens out4.4k
cached6.8k
cost / run$0.0018