Space Invaders · ling-2.6-1t
Output generated Cost / run $0.0049 Runtime 47.8s
Prompt for this run
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.
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 · 4 messages
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.
I'll build a complete Space Invaders game in a single HTML file with procedural graphics, all the requested features, and smooth gameplay.
/tmp/ws/index.html (16424 bytes)Successfully wrote 16424 bytes to /tmp/ws/index.html
I've built a complete, playable Space Invaders game with all the requested features: **Features:** - **Player Cannon** - Moves left/right with arrow keys or A/D, shoots with spacebar. Has temporary invincibility after death with blinking effect. - **Alien Grid** - 6 rows × 11 columns of procedurally drawn aliens (3 types: squid, crab, octopus) with distinct colors and shapes. They move side-to-side and drop down when hitting edges. - **Alien Fire** - Aliens shoot back at the player with red bullets. - **Destructible Bunkers** - 4 bunkers made of pixel grids that crumble when hit by bullets from either side. - **Score System** - 30/20/10 points per alien depending on type. High score saved to localStorage. - **Lives** - 3 lives with respawn invincibility. - **Procedural Graphics** - All sprites drawn with canvas rectangles, no external assets. **Controls:** - Arrow keys / A/D to move - Spacebar to shoot - Click anywhere to shoot (when playing) - START button or Enter to begin **Visual Effects:** - Animated starfield background - Explosion particles on destruction - Scanline CRT effect - Glowing bullets - Shield effect during respawn - Color-coded alien types (green, cyan, magenta) The game progressively gets harder as levels increase (aliens move faster), and victory advances to the next level with bonus lives.