🎮 Play Tetris
The game runs in your browser via WebAssembly, served straight from GitHub Pages. No build, no install, no account. Just blocks.
How to play
You control a stream of tetrominos — seven shapes made of four blocks each — that fall from the top of a 10-wide, 20-tall well. Slide and rotate them as they fall, slot them together to fill horizontal lines, and the lines vanish. The stack grows with every misfit. When it reaches the ceiling: game over.
Controls
| Key | Action |
|---|---|
← | Move tetromino left |
→ | Move tetromino right |
↓ | Soft drop (faster fall) |
↑ | Rotate tetromino |
Space | Pause / resume |
P | Pause / resume |
Esc | Pause / open menu |
On mobile, the game canvas renders on-screen Rotate, Start / Pause, and Soft Drop buttons.
Scoring
- 1 line — 40 × level
- 2 lines — 100 × level
- 3 lines — 300 × level
- 4 lines (Tetris) — 1200 × level
Level increases every 10 lines. Drop speed increases with each level.
Tips
- Keep the stack flat. A bumpy surface is an invitation to lose a gap you can't reach.
- Save the I-piece (long bar) for clearing four lines at once.
- Don't panic. The hard-drop temptation is real; placing beats slamming.
Build it yourself
git clone https://github.com/calebe94/tetris
cd tetris
git submodule update --init --recursive
make all
./bin/tetris
Desktop: needs g++, SDL2, SDL2_ttf, SDL2_mixer, SDL2_image. Web build: needs Emscripten SDK → make web.