Stack How to Make Tetris (Browser Falling Blocks 2026)

By Arron R.15 min read
How to make Tetris in 2026: model the 10-by-20 grid, encode the seven tetromino matrices with wall kicks, run a gravity tick that locks pieces on collision, cle

Alexey Pajitnov wrote the first version of Tetris on an Elektronika 60 in about three weeks in the mid-1980s, then spent another two months porting it to the IBM PC with Dmitry Pavlovsky and Vadim Gerasimov (verified against the Tetris Wikipedia entry on 2026-08-08). The mechanic is a single sentence: seven tetromino shapes fall on a 10-by-20 grid, the player rotates and shifts them, complete rows disappear and grant points, and the drop speed ramps as the score climbs. In this guide the pipeline for how to make Tetris runs from an empty repo to a shareable browser build: sketch the grid model and the seven rotation matrices on paper first, prompt WizardGenie to scaffold a Phaser 4 or vanilla Canvas project with the falling-block loop wired up, add the seven-bag piece randomiser and wall-kick table so pieces feel right, wire line-clear scoring and level speed-up, and finish with block textures from Sorceress AI Image Gen, a Korobeiniki-style ambient loop from Music Gen, and a satisfying line-clear chime from SFX Gen.

How to make Tetris browser pipeline: spawn, fall, lock, clear panels with a WizardGenie Phaser scaffold and Sorceress toolset for a falling-blocks game
The 2026 browser Tetris recipe: WizardGenie scaffolds the Phaser project, AI Image Gen supplies the block textures, Music Gen delivers a Korobeiniki-style ambient loop, SFX Gen ships the line-clear chime. Ship the whole build in one weekend.

What "how to make Tetris" actually means in 2026 (mechanic vs. trademark)

The phrase "how to make Tetris" hides three different requests. Some searchers want to clone the mechanic as a coding exercise, matching the exact seven tetromino colours, the Super Rotation System wall-kicks, and the modern scoring curve. Some searchers want to build a falling-blocks game as a portfolio piece in Phaser or vanilla Canvas, learning the grid model, the rotation matrices, and the collision loop along the way. And some searchers want to ship an actual browser or mobile falling-blocks game competing with the existing market of Tetris-mechanic clones on itch.io and the mobile stores. This guide covers the second and third groups: how to make Tetris as a browser build that runs on any modern phone or desktop, and how to ship it under a name that will not get you a cease-and-desist.

Two ground rules matter before any code gets written. First, the mechanic (seven tetromino shapes rotate and fall on a grid, complete horizontal rows disappear, speed ramps with level) is a game mechanic and is not copyrightable, so the loop itself is fair use. Second, the name Tetris, the specific rainbow-per-shape colour palette used by modern authorised versions, the exact wall-kick tables from the Super Rotation System, and the Korobeiniki arrangement from the Game Boy version are all protected by trademark and copyright. The Tetris Company has enforced this line successfully in court, most notably in the 2012 case Tetris Holding LLC v. Xio Interactive Inc., where a US federal judge ruled the iOS game Mino violated Tetris copyright on look-and-feel grounds (verified against the Tetris Wikipedia entry on 2026-08-08). Pick a new name for your build (Stack Quest, Line Drop, Block Rain), generate original block art in AI Image Gen, arrange your own version of the underlying 1860s Russian folk tune Korobeiniki in Music Gen (the tune itself is public domain but any specific arrangement is protected), and ship under your own brand. Every falling-blocks game on itch.io that is not published by The Tetris Company follows exactly this playbook.

The Tetris game loop in one minute (spawn fall lock clear score)

Five moving parts and nothing else. A grid, typically 10 columns wide by 20 rows tall, storing which cells are locked and which are empty. A queue of upcoming pieces served by a seven-bag randomiser (each of the seven tetromino shapes appears exactly once per set of seven, then the bag reshuffles) so the RNG never punishes the player with a five-piece drought. A currently-falling piece, stored as a small rotation matrix plus an (x, y) grid position, that responds to player input (left, right, rotate CW, rotate CCW, soft drop, hard drop, hold) and to a gravity tick that pushes it down one row every N milliseconds. A collision-and-lock pass that fires when the piece can no longer move down, freezing its cells into the grid and spawning the next piece from the queue. And a line-detect-and-clear pass that scans every row for full occupancy, removes any complete rows, shifts the rows above down, awards points, and increments the line counter.

That is the entire game. Win state does not exist in the traditional sense — Tetris has no ending, only ever-increasing levels and ever-faster gravity. Loss state is the "topping out" moment: a newly-spawned piece cannot find room to spawn at the top of the grid, or a locked block ends up above the visible playfield. The design job for how to make Tetris feel right is to tune four numbers — starting gravity (typically 1000 ms per row at level 1), gravity ramp curve (Tetris DS style: drop_ms = pow(0.8 - (level - 1) * 0.007, level - 1) * 1000), lock delay (typically 500 ms of grace after a piece touches down, allowing the player to slide or spin it before it locks), and appearance-and-line-clear delay (typically 200 ms to make the piece transition and line-clear flash readable). Miss any of these and the game either feels sluggish or feels unplayably twitchy. Get them right and the tap loop is the tutorial.

Seven tetromino rotation matrices in canonical colours: I-piece cyan, O-piece yellow, T-piece purple, S-piece green, Z-piece red, J-piece blue, L-piece orange, with a transpose-and-reverse rotation code snippet
The seven tetrominoes and their canonical colours. Rotate a matrix 90 degrees clockwise by transposing it and reversing each row — three lines of JavaScript covers every piece except the O-piece, which does not rotate. Wall-kick offsets bump a rotation inward when it would overflow.

Pick your engine for how to make Tetris: Phaser 4, vanilla Canvas, or Three.js

Three good browser targets in 2026, each with a different trade-off. Phaser 4.2.1 "Giedi" (released 9 July 2026, verified against the Phaser download page on 2026-08-08) is the default recommendation. Tetris is a fixed-grid, low-frame-rate game with sprite-simple visuals, and Phaser's Scene manager, Group container, and Sprite class map cleanly onto the grid render, the piece rendering, and the UI overlay. The tween chain is where Phaser earns its 900 KB minified footprint on a Tetris build: it makes the line-clear flash, the level-up shimmer, and the tetris (four-line clear) particle burst almost free to add, and those small pieces of feedback are the difference between a technically-correct Tetris and a Tetris players want to keep playing.

Plain HTML plus a single <script> tag on top of HTML5 Canvas 2D is the lean option. You write about 400 lines of vanilla JavaScript, produce a build under 15 KB total, and end up with something eligible for a JS13K-style code-golf entry or a pure-JavaScript learning demo. The trade-off is that every draw call, every animation frame, and every state transition is on you — there is no scene manager, no built-in input mapping, no tween library. Use vanilla Canvas if you want the exercise, the tiny build size, or a bootcamp-style project you can point to as evidence you understand game loops from first principles. The MDN Canvas API reference plus the requestAnimationFrame docs are all you need on the technical side.

Three.js r185 (verified against threejs.org on 2026-08-08) is possible but overkill for a straight Tetris. Three.js is built for 3D scenes with per-vertex geometry, PBR materials, and camera-controlled worlds, none of which a 2D falling-blocks game needs. Reach for Three.js only if you are doing a stylistic remix — a 3D-perspective view of the tetromino stack, a first-person "inside the well" camera, a Tetris Effect-style abstract particle background around the playfield. WizardGenie will scaffold in any of the three based on the prompt; the framework choice matters less than getting the rotation matrices and the seven-bag randomiser right.

Comparison table of browser engines for a Tetris clone: Phaser 4 versus vanilla Canvas versus Three.js across best-for build-size grid-model WizardGenie-scaffold and complexity
Phaser 4 is the default engine for a how to make Tetris browser build in 2026. Vanilla Canvas is the sub-15-KB jam entry; Three.js is for the 3D-perspective remix. All three are one prompt away from a WizardGenie scaffold.

Step 1 — grid model, tetromino rotation matrices, and gravity tick

This is the step every hobbyist Tetris tutorial rushes past, and it is the step that decides whether the game feels correct on the first playtest or spends its entire first hour debugging off-by-one errors on the grid. Before you open WizardGenie, sit with a piece of paper (or a spreadsheet) and write down three tables: the grid state model, the seven rotation matrices, and the gravity-per-level curve.

The grid is a 2D array, 10 wide by 20 tall (or 22 tall including two hidden rows above the visible playfield where new pieces spawn). Store 0 for an empty cell and a colour index 1 to 7 for a locked block. In JavaScript: const grid = Array.from({ length: 22 }, () => Array(10).fill(0)). When a piece locks, walk its rotation matrix and write the piece's colour index into each occupied cell.

The seven tetromino spawn matrices, using 1 for filled and 0 for empty, are: I-piece as a 4-by-4 with the second row filled ([[0,0,0,0],[1,1,1,1],[0,0,0,0],[0,0,0,0]]), O-piece as a 2-by-2 fully filled, T-piece as a 3-by-3 ([[0,1,0],[1,1,1],[0,0,0]]), S-piece as [[0,1,1],[1,1,0],[0,0,0]], Z-piece as the mirror [[1,1,0],[0,1,1],[0,0,0]], J-piece as [[1,0,0],[1,1,1],[0,0,0]], and L-piece as [[0,0,1],[1,1,1],[0,0,0]]. Rotate a matrix 90 degrees clockwise with a three-line helper: const rotate = m => m[0].map((_, i) => m.map(row => row[i]).reverse()). That covers six of the seven pieces — the O-piece never rotates. Rotate counter-clockwise by transposing then reversing the columns instead of the rows.

Wall kicks are what separate a Tetris that feels right from one where rotating near a wall drops the piece into the void. When a rotation places any cell of the piece off the grid or on top of a locked block, try shifting the piece one column left, then one right, then two columns for the long I-piece before rejecting the rotation and locking the piece in its previous orientation. The Super Rotation System introduced in Tetris Worlds 2001 (verified against the Tetris Wikipedia entry on 2026-08-08) codifies the exact five-attempt kick table modern Tetris games use; your clone should implement a similar but not identical table to keep clear of the Tetris Company's guidelines while still letting spin-in moves work.

Gravity is a single number: milliseconds per row of drop. At level 1, use 1000 ms per row. At level N, compute drop_ms = pow(0.8 - (N - 1) * 0.007, N - 1) * 1000. That formula, mostly unchanged since Tetris DS in 2006, produces 800 ms at level 2, 630 ms at level 3, 500 ms at level 4, and reaches sub-50-ms (over 20 rows per second) by level 15. Ramp level by one every ten cleared lines. Do not skip the lock delay: after the piece touches down, wait 500 ms before locking to allow the player to slide or spin it into a better position. Lock delay is what makes T-spins possible.

Step 2 — line detect, clear, score curve, and level speed-up in WizardGenie

Open WizardGenie. WizardGenie is the Sorceress game-native coding agent; it ships as both a desktop app (Windows installer with auto-update, available to Early Access supporters and above) and a no-install web build at the same URL. The coding-model lineup (verified 2026-08-08 in src/app/_home-v2/_data/tools.ts lines 735 to 742) covers Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, and MiniMax M2.7. Any frontier model in the lineup scaffolds a working Tetris on the first prompt. For a cheap run, pair a frontier planner (Claude Opus 4.7 or GPT-5.5) with a cheap executor (DeepSeek V4 Pro or Kimi K2.5) — the dual-agent Planner + Executor pattern lands the same output at roughly one-fifth the API cost of running a frontier model on the typing side.

The seed prompt is two paragraphs. "Scaffold a Phaser 4.2.1 Vite project called stack-blocks. Grid model: 10 columns wide by 22 rows tall, top 2 rows hidden. Store 0 for empty, colour index 1 to 7 for locked cells. Seven tetromino spawn matrices with canonical colours cyan I, yellow O, purple T, green S, red Z, blue J, orange L. Seven-bag randomiser that shuffles all seven pieces then serves them one at a time before reshuffling. Falling piece state: matrix, x, y, colour, rotation index. Input: A and Left arrow shift left, D and Right arrow shift right, W and Up arrow rotate CW, Z rotate CCW, S and Down arrow soft drop, Space hard drop, C hold-piece swap. Rotation with wall-kick attempts: same position, left one, right one, left two, right two, and the I-piece additionally tries left three and right three. Gravity tick: at level 1 drop one row every 1000 ms, at level N use pow(0.8 - (N - 1) * 0.007, N - 1) * 1000. Lock delay 500 ms after touch-down. Line-detect-and-clear pass scans every row, removes any where every cell is non-zero, and shifts rows above down. Score per clear: 100 x level for single, 300 x level for double, 500 x level for triple, 800 x level for tetris. Soft-drop bonus one point per cell, hard-drop bonus two points per cell. Level advances every ten cleared lines. Render: 10-by-20 visible grid with a NEXT queue showing three upcoming pieces on the right, a HOLD slot on the left, score and level display at the top. Game-over on spawn-collision. Save best score to localStorage keyed stack-blocks-best."

Feed that to any coding model and you get a working scaffold in about three minutes. The two parts to double-check the agent on are the line-clear pass and the level ramp formula. A naive line-clear implementation removes the row in place, which leaves a hole in the grid; the correct implementation removes the row and adds a new empty row at the top so everything above shifts down by one. A naive level ramp uses a linear drop_ms = 1000 - level * 50, which reaches zero at level 20 and either breaks the tick or makes the game unplayable; the correct formula is the exponential curve above, which asymptotes toward but never actually reaches zero.

The hold-piece mechanic is a small state addition worth calling out. Store a "held" slot alongside the falling piece. On C press, swap the held piece with the currently-falling piece, but only allow one hold per piece — block re-hold until the current piece locks. If the hold slot is empty, put the current piece there and spawn the next piece from the queue. The hold slot is what turns Tetris from reactive-only into a game where planning ahead is rewarded. It became the modern standard when Nintendo added it in The New Tetris in 1999 (verified against the Tetris Wikipedia entry on 2026-08-08).

Step 3 — AI Image Gen for block textures, Music Gen for the loop, SFX Gen for line clears

A default Tetris with flat CSS block colours and no audio feels like a placeholder. Three cheap polish passes lift it to shippable.

Open Sorceress AI Image Gen. First prompt series: the seven block textures. Prompt one per tetromino colour: "square glossy game-piece block texture, deep cyan, subtle inner bevel, transparent background, tile-safe, 128 by 128" (repeat for yellow, purple, green, red, blue, orange). Do not reuse the exact rainbow-per-shape colour palette from Tetris Company builds; pick your own shade set (jewel tones, pastel tones, retro CRT palette) or generate a solid neutral block plus seven overlay tints. Second prompt: a background pattern, "dark navy tileable game-play background with subtle grid lines and faint particle glow, 1024 by 1024, tile-safe". Third prompt: a title-screen illustration, "abstract falling-blocks title illustration with seven glowing tetromino shapes cascading down a dark background, cinematic lighting, 1920 by 1080". Total AI Image Gen budget: 9 to 11 generations at 5 to 20 credits each depending on the model and quality tier, roughly 45 to 220 credits (0.45 to 2.20 USD in Sorceress credits).

Open Music Gen. Music Gen bills 10 credits per generation (verified 2026-08-08 in src/app/music-gen/page.tsx line 28 as MUSIC_CREDIT_COST = 10, with a 2-credit WAV export per line 31's WAV_CREDIT_COST = 2). The Game Boy version of Tetris used the 1860s Russian folk tune Korobeiniki for Music A (verified against the Tetris Wikipedia entry on 2026-08-08), and every Tetris player alive associates that melody with the game. The melody itself is public domain, but Nintendo's specific arrangement is not — do not lift the chip-tune arrangement directly. Prompt Music Gen with "original chip-tune arrangement of the 1860s Russian folk melody Korobeiniki, up-tempo, minor key, seamless 90-second loop, 16-bit game-boy style synth, no drums past the intro". Preview and regenerate until the loop sounds background-appropriate. Two or three tries is typical, so budget 20 to 30 credits. Autoplay at 25 percent volume on first user interaction (browsers block audio autoplay before a click). Add a mute button in the corner.

Open SFX Gen. Sorceress SFX Gen uses the MiniMax Speech-02 sound-effect model with billing at 1 credit per second (verified 2026-08-08 in src/app/sfx-gen/page.tsx line 23 as SEED_AUDIO_CREDITS_PER_SECOND = 1). Generate five short clips. A "short crisp plastic click, 0.1 seconds, low-mid range" for the piece-lock event (about 1 credit). A "soft descending pitch bend, 0.3 seconds, gentle" for a single line clear (about 1 credit). A "bright chord ascending chime, 0.5 seconds, celebratory" for a double or triple clear (about 1 credit). A "dramatic four-note tetris fanfare, 1.2 seconds, ascending scale with a subtle chorus" for the four-line tetris clear (about 2 credits). A "short game-over descending swell, 1.5 seconds, minor" for topping out (about 2 credits). Under 8 credits total. Wire each clip to the matching event; keep the piece-lock clip at 30 percent volume so 200 locks per game do not exhaust the player's ears.

What a how to make Tetris project costs on Sorceress in 2026

Concrete asset and generation budget for a browser falling-blocks build from empty repo to shareable playable, all numbers verified 2026-08-08 against local Sorceress source:

  • Block textures and background (AI Image Gen): roughly 5 to 20 credits per asset depending on model and quality, 9 to 11 assets total, so 45 to 220 credits (0.45 to 2.20 USD). Skip the textured blocks and use flat CSS colours to knock this to just the title-screen illustration at 5 to 20 credits.
  • Korobeiniki-style ambient loop (Music Gen): 10 credits per generation, 2 to 3 tries typical, so 20 to 30 credits (0.20 to 0.30 USD). Add 2 more credits for the WAV export.
  • Sound effects (SFX Gen): 1 credit per second, 5 short clips totalling about 3.6 seconds, so roughly 8 credits (0.08 USD).
  • WizardGenie coding time: effectively free on the Sorceress side (bring your own model API key, or use one of the trial-key options for the smaller models). Model-side API cost for a 4-to-6-hour prompt session on a cheap Executor like DeepSeek V4 Pro is typically under 0.80 USD.
  • Total for one complete browser Tetris build: 73 to 260 credits, or roughly 0.73 to 2.60 USD in Sorceress credits, plus under 0.80 USD in model API time. Under 4 USD end-to-end for the whole project.

Sorceress bills 100 credits per dollar at the standard rate (CREDITS_PER_DOLLAR = 100 in src/lib/models.ts line 69). New accounts start with 100 free credits (SIGNUP_GRANT = 100 in src/app/api/admin/credits/route.ts line 12), which is enough to cover the sound effects and the ambient loop with headroom for a couple of block-texture regenerations. The Sorceress Lifetime tier at 49 USD one-time (LIFETIME_PRICE = 49 in src/app/plans/page.tsx line 51) unlocks unlimited SFX Gen and heavy AI Image Gen use, which matters if you plan to spin the same falling-blocks engine into a series of themed variants (space Tetris with asteroid blocks, garden Tetris with plant blocks, cyberpunk Tetris with neon blocks). The mechanic is public; the theme is yours.

For related browser-game pipelines that share this "design the grid, prompt the coder, ship the browser build" spine, the closest reads are Flap How to Make Flappy Bird (Browser Loop 2026) for the one-mechanic-plus-scoring pattern on a physics classic, Coil How to Make a Snake Game in Python (Turtle 2026) for the grid-based movement sibling with a different collision model, and Tally How to Make a Clicker Game (Browser Score Loop 2026) for the exponential-score weekend-browser-project pattern on an incremental mechanic. The Sorceress Tools Guide is the master index. Under 4 USD, one weekend, and how to make Tetris is a done deal for anyone who can hold seven rotation matrices in their head for an afternoon.

Frequently Asked Questions

Can I legally make a Tetris clone and sell it?

You can build a falling-blocks game using the Tetris mechanic (seven tetromino shapes rotate and fall on a grid, complete rows disappear, speed ramps with level) because game mechanics are not copyrightable in most jurisdictions. What you cannot do is call the game Tetris, use the specific rainbow-per-shape colour palette from modern authorised versions, copy the exact Super Rotation System wall-kick tables verbatim, or reuse the sound-track Korobeiniki with the same arrangement. The Tetris Company enforces its trademark and copyright aggressively - in the 2012 case Tetris Holding LLC v. Xio Interactive Inc., a US federal judge ruled the iOS game Mino violated Tetris copyright on look-and-feel grounds (verified against the Tetris Wikipedia entry on 2026-08-08). Pick a new name for your build (Stack Quest, Line Drop, Block Rain), generate original block art in AI Image Gen, arrange your own Korobeiniki-style loop in Music Gen (the underlying folk tune is 1860s Russian public domain, but your arrangement should be original), and ship under your own brand. Every falling-blocks game on itch.io and the App Store that is not published by The Tetris Company follows this exact playbook.

How long does it take to make a browser Tetris clone?

About six to twelve hours for a first shippable browser build if you follow the pipeline in this guide. Roughly one hour to sketch the 10-by-20 grid model, the seven tetromino rotation matrices, and the scoring curve on paper. About two to four hours to prompt WizardGenie through the falling-block loop, the collision-and-lock logic, the line-detect-and-clear pass, and the level speed-up. Around one hour to add the seven-bag piece randomiser (each tetromino guaranteed once per set of seven, the modern standard verified against the Tetris Wikipedia entry on 2026-08-08). Roughly 90 minutes to wire the wall-kick table so a rotating piece near a wall bumps inward instead of getting stuck. About 30 minutes to build the score display, level, hold, and next-piece preview. Around 20 minutes for AI Image Gen block textures and 15 minutes for Music Gen and SFX Gen audio. Experienced JavaScript developers who have written a grid-based falling-blocks game before can hit playable in under four hours; the extra hours cover the polish pass that makes rotations, wall-kicks, and line clears feel right instead of janky.

Which browser engine should I use for a Tetris clone in 2026?

Phaser 4.2.1 Giedi (released 9 July 2026, verified against phaser.io/download/stable on 2026-08-08) or plain HTML5 Canvas both work well. Tetris is a fixed-grid, low-frame-rate game (typical drop rate starts at one row per second, tops out around 20 rows per second at the highest levels) with no per-frame physics, no sprite animation beyond block textures, and no scrolling world - so it does not need Phaser's arcade physics body or scene manager to shine. Vanilla Canvas plus requestAnimationFrame ships a full Tetris in about 400 lines of JavaScript and under 15 KB total, which is jam-entry small. Phaser 4 is worth it if you want the tween chain for line-clear flash animations, the Scene manager for a menu-to-game transition, or particle effects on a tetris (four-line clear). Three.js r185 (verified against threejs.org on 2026-08-08) can drive a 3D-perspective falling-blocks build for a stylistic remix, but most searchers want the classic flat 2D presentation. WizardGenie will scaffold the entire project in any of the three based on the prompt.

How do the seven tetromino rotation matrices work?

Each tetromino is stored as a small square matrix of cells, and rotating the piece means transforming the matrix. The seven shapes and their spawn matrices, using 1 for a filled cell and 0 for empty, are: I-piece as a 4-by-4 with the second row filled ([[0,0,0,0],[1,1,1,1],[0,0,0,0],[0,0,0,0]]), O-piece as a 2-by-2 fully filled, T-piece as a 3-by-3 with a T-shape ([[0,1,0],[1,1,1],[0,0,0]]), S-piece as a 3-by-3 ([[0,1,1],[1,1,0],[0,0,0]]), Z-piece as the mirror ([[1,1,0],[0,1,1],[0,0,0]]), J-piece ([[1,0,0],[1,1,1],[0,0,0]]) and L-piece ([[0,0,1],[1,1,1],[0,0,0]]). Rotate a matrix 90 degrees clockwise by transposing it and reversing each row (function rotate(m) { return m[0].map((_, i) => m.map(row => row[i]).reverse()); }). The O-piece never rotates; the I-piece and S/Z pieces are traditionally rotated between two states rather than four to avoid feeling wrong. When rotation places a piece off the grid or on top of a locked block, apply a wall-kick offset (try shifting one column left, then one right, then two columns for the I-piece) before rejecting the rotation. The Super Rotation System introduced in Tetris Worlds 2001 (verified against the Tetris Wikipedia entry on 2026-08-08) codifies the exact kick offsets modern Tetris games use; your clone should implement a similar but not identical table.

How do you score a Tetris clone?

The modern scoring formula, mostly unchanged since Tetris DS in 2006 (verified against the Tetris Wikipedia entry on 2026-08-08), awards points per line cleared, multiplied by level, with big bonuses for multi-line clears: single line = 100 times level, double = 300 times level, triple = 500 times level, and a tetris (four lines at once) = 800 times level. Soft-drop bonus is one point per cell dropped, hard-drop bonus is two points per cell. Level advances every ten lines cleared, and gravity speeds up on each level so the piece falls one row every (0.8 - (level - 1) times 0.007) to the power of (level - 1) seconds - starting at one second per row at level 1 and reaching about 20 rows per second by level 15. Advanced scoring adds T-spin bonuses (recognise when a T-piece rotates into a tight three-corner-block slot), back-to-back bonuses (award 1.5x for consecutive tetrises or T-spins), and combo bonuses (award 50 times level times combo-length for consecutive line clears with no dry pieces in between). Start with the base formula, ship a playable build, then add the advanced scoring layers once the core loop feels right.

Sources

  1. Tetris - Wikipedia (creator, history, and mechanic reference)
  2. Phaser 4 - HTML5 Game Framework
  3. MDN - Canvas API 2D drawing reference
  4. MDN - requestAnimationFrame (game loop timing)
Written by Arron R.·3,448 words·15 min read

Related posts