Skip to content
UniKit

Tetris

A playable Tetris: move and rotate with the arrow keys / WASD, hard drop with space, and pieces fall on a real millisecond timer (pausable, speed editable) with a landing preview, a seed-reproducible 7-bag sequence, automatic line clears and live scoring.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Tetris board

Move and rotate with the arrow keys / WASD, hard drop with space; pieces fall on a timer (pausable, speed editable), full rows clear automatically, and stacking to the top ends the game.

Next
JZI
Piece 0 · score 0 · lines 0 · level 1 · New game: the pieces are queued from the seed
Score
0
Lines
0
Level
1
Pieces dropped
0
Stack height
0

← → move · ↓ soft drop (+1 point) · ↑ / X rotate clockwise · Z counter-clockwise · space hard drop

Drop log

0 pieces dropped this game

No pieces dropped yet

What this tool does

  • Play Tetris right here: move and rotate with the arrow keys / WASD and hard drop with space, or use the buttons under the controls; the ghost preview shows where the current piece will land.
  • Reproduce the same piece sequence from a seed: 7 pieces per bag, shuffled inside the bag, so the same seed always gives the same order — handy for comparing two runs.
  • Turn auto-fall off and stack slowly to practise line clears: full rows clear automatically, and the score is lines × level plus the soft/hard drop distance.

Example

Input

10 columns · 20 rows · piece seed demo · 700 ms auto fall

Output

Piece 0 · score 0 · lines 0 · level 1
Stack height 0 · empty board
The next pieces follow the seed demo 7-bag order

The game starts on an empty board with the first piece dealt from the seed, and the landing preview is computed live with the same collision rule as game-core. Hard drop scores 2 per cell, soft drop 1 per cell, and clearing 1/2/3/4 lines scores 100/300/500/800 times the level.

Frequently asked questions

How do I play, and when is the game over?

Use ← → or A/D to move, ↓ to soft drop (+1 per cell), ↑ / X to rotate clockwise, Z to rotate counter-clockwise and space to hard drop (+2 per cell); on a touch screen use the Left / Right / Rotate CW / Rotate CCW / Soft drop / Hard drop buttons. When the stack reaches the top and the next piece no longer fits, the game ends — undo a step or restart.

Does it fall on its own?

Auto fall is on by default and drops one cell every 700 ms (the interval is editable, 80–2000 ms) — a real timer. Press Pause to stop it, or switch auto fall off for pure manual play.

How are the score and line clears computed?

After a piece locks, every full row is removed and empty rows are added on top (the real game-core rule). The score is the line-clear base (100 for 1 line, 300 for 2, 500 for 3, 800 for 4) times the current level, plus the drop distance (1 per cell soft drop, 2 per cell hard drop); every 10 cleared lines raise the level by one.

Is the piece order random?

No. Every 7 pieces form a bag containing all seven shapes once, and the order inside a bag comes from xorshift128 keyed by the seed, so the same seed always gives the same order. "Restart this game" reuses the same parameters and reproduces the opening pieces exactly.

Are there rotation limits?

A rotation first tries the same spot, then one cell left, one cell right and one cell up (a simple wall kick); if all four are blocked it cannot rotate and the page says so. The O piece never rotates. Pieces may land against the wall, and the ghost preview is exactly where the piece will land.

Keywords:tetris

Related tools