Asteroids · qwen3.8-2.4t-a95b
Output generated Cost / run $0.0595 Runtime 75.1s
Prompt for this run
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.
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
METRICS
Transcript · 6 messages
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.
thinking
Create a complete Asteroids game in a single index.html. Contents to include: spaceship rotation/thrust/inertia, bullets, asteroid splitting, screen wrap, score, lives, particle explosions, restart, hypertext (warp) if possible. Keep it robust.
/tmp/ws/index.html (12827 bytes)Successfully wrote 12827 bytes to /tmp/ws/index.html
thinking
Quick sanity check: verify that the file exists, and maybe do a JS syntax check with node (if available).
{"command":"cd /tmp/ws && ls -la index.html && node -e \"\nconst html = require('fs').readFileSync('index.html','utf8');\nconst js = html.ma-rw-r--r--. 1 node node 12830 Aug 13 01:25 index.html JS syntax OK
thinking
Wait — the syntax check ran, but since the script is an IIFE using browser APIs, the new Function check is only verifying the syntax. No problem there. Done.
Done — `/tmp/ws/index.html` is a fully self-contained Asteroids game (CSS in `<style>`, JS in `<script>`, zero external resources). JS syntax verified. **Features:** - 🚀 **Vector ship** — rotate with ←/→ (or A/D), thrust with ↑/W (inertia + drag physics), drawn as a classic line-art triangle with animated exhaust flame and thrust particles - 💥 **Shooting** — SPACE fires bullets (with a cap of 6 onscreen), bullets wrap around edges - 🪨 **Asteroids** — procedurally generated jagged polygons, 3 sizes; big → 2 medium → 2 small (20/50/100 points), each with random spin, speed, and rotation - 🌀 **Screen wrapping** for ship, bullets, and asteroids - ❤️ **Lives & score** — HUD shows score, level, and lives as mini ship icons; 3s invincibility blink on respawn (waits for center to be clear) - 🎮 **Game states** — menu, playing, paused (P), game over; Enter to start/restart - ✨ **Polish** — particle explosions, screen shake, starfield background, drifting asteroids behind the menu, level progression (more rocks each level)