A simple HTML/CSS/JS implementation of Tetris
- JavaScript 74.1%
- CSS 15.5%
- HTML 10.4%
|
|
||
|---|---|---|
| index.html | stylize OSD text | |
| LICENSE | add LICENSE | |
| README.md | add Demo link | |
| styles.css | stylize OSD text | |
| tetris.js | stylize OSD text | |
| tetris.png | fix grace period (4), remove unused images | |
| tetrisbg-small.png | add Demo link | |
▟ Tetris
A feature-rich Tetris implementation in pure JavaScript - no frameworks, no dependencies.
Based on jorisroovers/tetris.
Demo
Want to try it out in your web browser? https://bsd.pm/tetris/
Features
- Classic Tetris gameplay with all 7 standard tetrominoes
- 3D Depth - extrusion effect that gives the playfield depth
- Afterglow system - falling pieces leave customizable trails:
- Toggle on/off, adjust opacity, decay time, and hue
- Smoke Decay, Pulse Decay, and Wireframe afterglow modes
- Colorize Afterglow with adjustable hue
- Row Clear - enable/disable the row clear animation
- Score tracking and level progression
- Next block preview
- Hard drop and rotation
Controls
| Key | Action |
|---|---|
← / H |
Move left |
→ / L |
Move right |
↓ / J |
Soft drop |
↑ / K |
Rotate |
Space |
Hard drop |
P |
Pause / Resume |
Enter |
Restart (when game over) |
How to run
Open index.html in any modern browser. No build step, no server required.