Score
0
Lines
0
Level
1
Best
0
Next
Hold

Online Tetris Game

Select speed to begin

Controls
move
rotate
soft drop
Space
hard drop
C
hold/swap
P
pause
F
fullscreen

Paused

Press P to resume

Game Over

Score: 0
Best: 0
Metric Value Copy
{{ row.label }} {{ row.value }}
:

Introduction:

Tetrominoes are geometric puzzle pieces that fall into a grid and lock into filled rows. The aim is to place shapes cleanly so complete lines disappear before the board fills. Many players use this classic falling blocks game strategy to build stacks that set up satisfying clears.

You choose a starting speed then guide each piece with the arrow keys, rotate with the up key, and lock instantly with space. A ghost outline shows the landing spot and a hold slot lets you save a useful shape for later so planning gets easier with practice.

Points rise when lines clear and when you drop pieces quickly. Levels increase every 10 lines so gravity accelerates and decision time shortens. A patient start helps and a quick move to a faster pace keeps the rhythm engaging.

Keep an eye on the best score shown above the board. If a total seems high or low, remember that soft drops and hard drops add extra points even when no line clears happen.

Technical Details:

The playfield is a 10 × 20 grid. Falling pieces are the seven standard tetrominoes, each with four rotation states. Gravity advances on a fixed interval that depends on the chosen speed and current level, while player inputs adjust position, rotation, and locking.

Score is the sum of line‑clear points and drop points. Clearing n lines at once yields a level‑scaled award, and each cell descended by the player adds a small bonus. Levels increase after every 10 cleared lines, reducing the gravity interval down to a floor.

Distribution uses a seven‑piece bag: all tetromino types are shuffled, consumed without replacement, then a new bag is formed and shuffled again. This improves variety compared with pure randomness and reduces droughts.

Rotation uses simple kicks that try small horizontal and vertical offsets when a turn collides. A ghost outline previews the landing row, and a one‑piece hold allows swapping once per spawn. The best score is remembered on the device.

S = Sclear+Sdrop Sclear = { 100·Lif n=1 300·Lif n=2 500·Lif n=3 800·Lif n4 } Sdrop = 1·Nsoft+2·Nhard
Symbols and units
Symbol Meaning Unit/Datatype Source
STotal scorepointsderived
LCurrent levelinteger ≥ 1derived
nLines cleared in one lock0–4derived
NsoftCells descended via soft dropinteger ≥ 0derived
NhardCells descended via hard dropinteger ≥ 0derived
gmsBase gravity intervalmsdifficulty
Worked example

At level 3, you hard drop 5 cells and soft drop 3 cells, then clear 2 lines.

Sclear=300·3=900 Sdrop=1·3+2·5=13 S=900+13=913

Interpretation: drop bonuses are modest; most points come from multi‑line clears scaled by level.

Level thresholds and interpretation
Threshold band Lower bound (lines) Upper bound (lines) Interpretation Action cue
Level 109Entry speedWarm up stacking
Level 21019Faster gravityFavor hard drops
Level 32029Brisk paceUse hold wisely
Level 43039Challenging speedPrioritize safety
Level 54049High pressureSecure quick clears

Difficulty sets the base gravity: Slow = 900 ms, Medium = 700 ms, Fast = 500 ms. The tick interval per level is interval = max ( 60 , gms 50·(L1) ) .

Validation and bounds from the implementation
Field Type Min Max Step/Pattern Error text Placeholder
Volumerange0100integer
Ghosttoggle01boolean
Holdtoggle01boolean
Soundtoggle01boolean
Difficultychoiceeasy | normal | hard

Randomness & reproducibility: pieces are sampled without replacement within each bag, then reshuffled. There is no user‑visible seed and sequences are not intended to be replayed.

Networking & storage: a single rendering library is requested from a public CDN; the best score is stored under a local key on the device. No telemetry or remote API calls are performed by the game code.

Performance: per‑tick updates and draws operate in O(rows × cols) time; preview canvases are redrawn on state changes and resize events.

Security considerations: inputs are keyboard events only; no untrusted text is rendered; fullscreen requests and audio contexts follow browser permissions. There are no secrets or keys handled by the client.

Assumptions & limitations

  • Board size is fixed at 10 × 20.
  • Spawn starts near column 4 with a negative row; early collision ends the game Heads‑up.
  • Rotation uses simple kicks; there is no T‑Spin recognition.
  • No combo bonuses or back‑to‑back scoring.
  • Drop points are added only when a piece locks.
  • Only one hold swap per spawn is permitted.
  • Gravity speed decreases with level until a 60 ms floor.
  • Best score persists to device storage only.

Edge cases & error sources

  • Audio may be muted until a user gesture activates the audio context.
  • Local storage may be unavailable in private modes.
  • Fullscreen can be blocked by browser policy.
  • WebGL context loss or unsupported hardware can fall back poorly.
  • High‑DPI scaling may affect visual sharpness.
  • Window resize during play briefly refits the board.
  • Tab throttling can slow timers when unfocused.
  • OS‑level shortcuts may intercept keys on some layouts.
  • Very slow devices can miss animation frames.
  • Mobile touch movement is limited to prevent accidental scroll.

Privacy & compliance

No data is transmitted or stored server‑side. Outcomes are purely random and have no monetary value.

Step‑by‑Step Guide:

Falling tetrominoes are placed to clear lines and build score.

  1. Choose a starting speed: Slow, Medium, or Fast.
  2. Move with ← →, rotate with ↑, and drop with Space.
  3. Use C to hold or swap once per spawn.
  4. Chase line clears; chain bigger clears for higher awards.
  5. Use P to pause and F for fullscreen.
  6. Adjust sound with the toggle and volume slider.

Example: Stack flat on the left, save the I‑piece in hold, then hard drop it for a four‑line clear.

Finish by aiming for a new best score.

Features:

  • Seven‑piece bag randomisation for fair variety.
  • Ghost preview and one‑piece hold.
  • Soft and hard drops with bonus points.
  • Three starting speeds with level‑based acceleration.
  • Next and hold previews in separate panels.
  • Pause, fullscreen, and adjustable sound.
  • Best score saved on device.

FAQ:

Is my data stored?

Only the best score is saved to device storage; no server storage or accounts are used.

Clear site storage to reset the best score.
How are points calculated?

Line clears award 100, 300, 500, or 800 times your level for 1–4 lines. Soft drops add 1 per cell; hard drops add 2 per cell.

What controls are available?

Move ← →, rotate ↑, soft drop ↓, hard drop Space, hold C, pause P, fullscreen F, mute M. Toggles for ghost, hold, and sound are provided.

Can I play without a connection?

After the rendering script is cached, it can run without a connection; the first load may require network access.

What happens near level changes?

Every 10 cleared lines increases the level and reduces the gravity interval; timing changes immediately after the line tally updates.

Is there a cost or license?

No payment or account flow is implemented. Licensing terms are not specified in the package.

How do I enable or disable the ghost piece?

Use the ghost toggle. It can be changed any time; the preview updates on the next draw.

Why does hard drop score more than soft drop?

Hard drop is rewarded at 2 per cell to encourage quick commits and faster play, while soft drop grants 1 per cell.

Troubleshooting:

  • No sound: press any key or click once to activate audio.
  • Best score not saving: enable local storage for this site.
  • Key presses scroll the page: focus the board and try again.
  • Graphics stutter: reduce other tabs or try a smaller window.
  • Fullscreen fails: check browser permissions for fullscreen.
  • Ghost not visible: ensure the ghost toggle is on.

Advanced Tips:

  • Tip Use hold to save I‑pieces for four‑line clears.
  • Tip Keep the stack flat; avoid tall spires on the sides.
  • Tip Soft drop only when it meaningfully advances placement.
  • Tip Watch the next preview to plan two moves ahead.
  • Tip When unsure, place safely and clear one line.
  • Tip Pause briefly after level ups to adjust rhythm.

Glossary

Tetromino
Shape of four squares used as pieces.
Ghost
Outline showing the landing row.
Hold
Reserve slot to save or swap one piece.
Soft drop
Manual descent by one row at a time.
Hard drop
Instant descent to the landing row.
Gravity
Automatic downward movement on a timer.