Asteroids · glm-4.6
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.
transcript · 4 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
The user wants me to create a complete Asteroids game in a single HTML file. Let me think about the key components: 1. Canvas-based game with vector graphics 2. Ship that can thrust and rotate 3. Shooting mechanics 4. Asteroids that split into smaller pieces 5. Screen edge wrapping 6. Score system 7. Lives system 8. All self-contained in one HTML file I'll need to: - Create a canvas element - Implement vector graphics drawing functions - Handle keyboard input for controls - Create game objects (ship, asteroids, bullets) - Implement physics (movement, rotation, collision detection) - Add game logic (splitting asteroids, scoring, lives) - Create a game loop with animation frame Let me structure this as a complete HTML file with inline CSS and JavaScript.
I'll create a fully playable Asteroids game with vector graphics, complete with ship controls, asteroid splitting, scoring, and lives system.
/tmp/ws/index.html (17950 bytes)Successfully wrote 17950 bytes to /tmp/ws/index.html
thinking
I've created a complete Asteroids game in a single HTML file. The game includes: 1. **Ship mechanics**: Thrust and rotation using arrow keys, with momentum-based physics 2. **Shooting**: Space bar to shoot bullets with cooldown 3. **Asteroids**: Procedurally generated with random vertices, split into smaller pieces when shot 4. **Screen wrapping**: All objects wrap around screen edges 5. **Collision detection**: Between ship-asteroids and bullet-asteroids 6. **Score system**: Points for destroying asteroids (more points for smaller ones) 7. **Lives system**: 3 lives with invulnerability period after respawn 8. **Visual effects**: Thrust flame, explosion particles, blinking when invulnerable 9. **Game over/restart**: Game over screen with space to restart The game uses vector graphics exclusively with no external assets, and the retro green phosphor aesthetic matches the classic Asteroids style. All game logic, rendering, and controls are fully functional and self-contained in the single HTML file.
Created a fully playable Asteroids game with vector graphics! Features include: - **Ship controls**: Arrow keys to rotate, up arrow to thrust, space to shoot - **Physics-based movement**: Momentum, friction, and screen edge wrapping - **Asteroid mechanics**: Procedurally generated asteroids that split into smaller pieces - **Collision detection**: Ship-asteroid and bullet-asteroid collisions - **Scoring system**: Points for destroying asteroids (10-30 points based on size) - **Lives system**: 3 lives with 2-second invulnerability after respawn - **Visual effects**: Thrust flames, explosion particles, blinking invulnerability - **Level progression**: New asteroid wave when all destroyed The game uses classic vector graphics with a retro green phosphor aesthetic, completely self-contained with no external dependencies. Press SPACE to start shooting, and enjoy the nostalgic Asteroids experience!
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
EVALUATION
Functional Asteroids clone with ship, asteroids, score/lives, and game over screen after losing all lives.
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.