Tetris · gemini-3.1-flash-lite
Output generated Cost / run $0.0053 Runtime 13.7s
Prompt for this run
Build a playable Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
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 Tetris on a canvas with all seven tetrominoes, rotation, line clears, increasing speed, a next-piece preview, and score.
thinking
**Developing Tetris Logic** I'm currently focused on implementing the core game mechanics. My immediate priority is to get all seven tetromino shapes rendering and rotating correctly. Following that, I'll tackle line clearing and the logic for increasing game speed. **Implementing Tetromino Movement** My current efforts are centered on enabling accurate tetromino movement and rotation within the game grid. I've defined the shapes and begun implementing the matrix operations for rotation, and I'm now refining collision detection logic for seamless gameplay.
index.html (5772 bytes)Successfully wrote 5772 bytes to index.html
The Tetris game has been implemented in a single self-contained `index.html` file, including all requested features: * **Tetrominoes:** All seven classic shapes (I, J, L, O, S, T, Z) with unique colors. * **Rotation:** Q and W keys for counter-clockwise and clockwise rotation, with wall-kick detection enabled. * **Mechanics:** Fully playable with score tracking, line clear detection, and an increasing difficulty setting (drop speed increases as you clear lines). * **UI:** Includes a "Next Piece" preview box and a live score tracker. * **Controls:** Arrow Left/Right to move, Arrow Down to drop, Q/W to rotate. You can now open `index.html` in any modern web browser to play.