oneshotlm
Compare all models on this prompt →

Space Invaders · gemini-3.1-flash-lite

Output generated Cost / run $0.0049 Runtime 14.3s

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.

⛨ sandboxed Open in new tab ↗

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

modelgemini-3.1-flash-lite
vendorGoogle
harnesspi-agent
generated2026-07-22

METRICS

runtime14.3s
tokens in4.8k
tokens out2.4k
cached0
cost / run$0.0049
Transcript · 4 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
**Developing Core Game Mechanics**

I'm currently focused on implementing the fundamental elements for Space Invaders. My priority is getting the player cannon to move and fire accurately within the canvas. Simultaneously, I'm laying the groundwork for the alien grid's movement and initial behavior.

**Implementing Game State**

My focus has shifted to integrating core game state elements. I'm now detailing the variables for score, lives, and the current wave, and beginning to outline the game loop structure using `requestAnimationFrame`. I'm also considering how to represent entities like the player, bullets, and enemies with simple shapes and their respective properties.

→ write index.html (5588 bytes)
toolResult

Successfully wrote 5588 bytes to index.html

assistant

The Space Invaders game is now built and contained within the `index.html` file. You can open this file in any modern web browser to play. ### Features Included: - **Player Cannon:** Controlled with Arrow Keys, shooting via Space Bar. - **Enemies:** A grid of aliens that move horizontally and descend when hitting a wall. - **Procedural Graphics:** All elements are drawn using Canvas 2D primitives. - **Game Logic:** Score tracking, lives system, and collision detection. - **Self-contained:** No external libraries or assets. ### How to run: Simply open `index.html` in your web browser.