2048 Split Screen - Local 2 Player Game
Play 2048 in split-screen mode with a friend locally. Features 2-player support, keyboard/touch controls, and persistent saving.
About
This tool is a dual-instance implementation of the sliding tile puzzle, designed for local competitive play. Unlike the standard single-player variant, this application runs two independent game logic threads simultaneously within the browser DOM, allowing two users to compete side-by-side on a single device.
The core mechanic relies on a deterministic sliding algorithm. When a directional input is triggered (Vector v), all tiles shift maximally in that direction. If two tiles of value x collide, they merge into a single tile of value 2x. The game ends when the grid is full and no adjacent tiles satisfy the condition tilei,j = tileneighbor.
Pro Tip: Use the "Tabletop Mode" toggle on tablets to invert Player 1's screen, enabling a face-to-face seating arrangement.
Formulas
The scoring algorithm for a single merge event is defined as:
Scorenew = Scoreold + {
Where v represents the numerical value of a tile. The maximum theoretical score depends on the spawn probability of 4s versus 2s.
Reference Data
| Tile Value (2n) | Probability (P) | Color Hex | Points per Merge |
|---|---|---|---|
| 2 | 0.9 (Spawn) | #eee4da | 4 |
| 4 | 0.1 (Spawn) | #ede0c8 | 8 |
| 8 | Merge Only | #f2b179 | 16 |
| 16 | Merge Only | #f59563 | 32 |
| 32 | Merge Only | #f67c5f | 64 |
| 64 | Merge Only | #f65e3b | 128 |
| 128 | Merge Only | #edcf72 | 256 |
| 2048 | Target | #edc22e | 4096 |