Tetris · glm-4.7-flash
Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
transcript · 4 messages
Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
thinking
The user wants a single-file HTML Tetris game with: 1. Canvas-based rendering 2. All seven tetrominoes (I, O, T, S, Z, J, L) 3. Rotation mechanics 4. Line clear functionality 5. Increasing speed as you progress 6. Next piece preview 7. Score tracking I'll create a complete, self-contained HTML file with CSS and JavaScript inline. Let me design this properly: - Use HTML5 Canvas for the game board - Implement all 7 tetrominoes with their shapes - Use rotation system (SRS or basic rotation) - Collision detection - Line clear detection and removal - Speed increase based on score/level - Next piece display - Score calculation Let me write this out in one complete file.
I'll create a complete, self-contained Tetris game in a single HTML file with canvas rendering, all features requested.
index.html (18466 bytes)Successfully wrote 18466 bytes to index.html
thinking
The file has been created successfully. Let me verify it works by checking if there are any syntax errors or issues.
The Tetris game has been created as a single, self-contained HTML file at `index.html`. It includes: - **All 7 tetrominoes**: I, O, T, S, Z, J, L with unique colors - **Canvas rendering**: Main game board and next-piece preview - **Rotation system**: With wall kick support for smooth rotation near walls - **Line clearing**: Detects and removes complete lines - **Increasing speed**: Level system that increases drop speed every 10 lines - **Next-piece preview**: Shows upcoming piece in a separate canvas - **Score tracking**: Points for line clears, soft drops, and hard drops - **Ghost piece**: Shows where the piece will land - **Controls**: - ← →: Move left/right - ↑: Rotate - ↓: Soft drop (faster fall) - Space: Hard drop (instant drop) - P: Pause/unpause The game features a modern dark theme with gradient background, glowing effects, and smooth animations. The score increases with line clears multiplied by the current level.
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 Tetris with falling pieces, next preview, score, and responsive movement/rotation via keyboard input.
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.