/tetromino
prompt.txt
01you are the world's leading HTML programmer that specializes in game dev. here is your next task:
02 Generate a single, self-contained HTML file (all CSS and JavaScript inline, no external dependencies) that implements a fully
03 playable Tetris game. The file must work in modern browsers when opened directly, with no additional setup.
04
05 ### Required Features:
06
07 1. Tetrominoes: All 7 standard pieces (I, O, T, L, J, S, Z) with correct shapes and distinct colors.
08 2. Controls:
09 - Left/Right Arrows: Move active piece horizontally
10 - Up Arrow: Rotate piece clockwise
11 - Down Arrow: Soft drop (increase fall speed temporarily)
12 - Space Bar: Hard drop (drop piece instantly to the lowest valid position)
13 - R Key: Restart game when in game over state
14 3. Core Mechanics:
15 - 10-column x 20-row play grid (standard Tetris dimensions)
16 - Pieces fall at a base speed of 1 row per 1000ms, decreasing by 50ms every 10 cleared lines (minimum 100ms)
17 - Line clearing: Full horizontal lines are removed, all blocks above shift down immediately
18 - Scoring: 100 pts per line, 300 for 2 lines, 500 for 3 lines, 800 for 4 lines (Tetris)
19 - Next piece preview: Display the next tetromino to spawn in a small preview area
20 - Game over: Triggered when a new piece cannot be placed at the top-center spawn position
21 4. UI Elements:
22 - Display for current score, level, and total lines cleared
23 - Game over overlay showing final score and "Press R to Restart" instruction
24 - Clear visual distinction between the grid background, placed blocks, and active piece
25 ### Constraints:
26
27 - Single .html file only, all CSS and JS must be inline in <style> and <script> tags
28 - No external libraries, frameworks, CDNs, or imported resources
29 - Valid HTML5, use modern but widely supported CSS/JS features (ES6+ is fine)
30 - Prioritize correct functionality over visual polish
31 Return only the complete HTML file code, no additional explanation or markdown formatting.
32 don't be lazy about it. and don't be boring. do your best work. impress me