A tactile Three.js take on 2048: beveled tiles, soft shadows, animated slides and merges, and a focused graphite-and-porcelain interface.
Requires Node.js/npm and Python 3.
npm install
npm startOpen http://127.0.0.1:5173. The app uses native ES modules and a local Three.js import map; no build step is required. Keep node_modules/three/build/ available when serving the app. Google Fonts is optional; system fonts provide a fallback.
- Arrow keys, W A S D, swipes, or directional buttons move the board.
- Matching tiles merge once per move. A successful move adds a 2 or a 4.
- Z or Undo restores the previous move. Personal bests are retained.
- Your current game and sound preference save locally in this browser.
- Toggle 3D view / Top view to change the camera.
- Sound is off initially. Enable it with the speaker button.
- Reach 2048, then continue playing or start fresh.
The game supports reduced motion and exposes the board and updates to assistive technology. If WebGL is unavailable or its context is lost, a flat board uses the same game rules.
src/game.js: renderer-independent rules and saved-state validation.src/board.js: Three.js scene, cached materials, camera and animations.script.js: controls, storage, sound, dialogs and accessible UI.index.html,style.css: responsive interface.
Browser-only playtesting in Codex Browser covered keyboard and pointer movement, four equal tiles merging into two pairs, invalid moves, undo, saved-state reload, restart, help input blocking, camera switching, and desktop / 390px mobile layout. No test framework or automated test suite was added. Win/loss dialogs and GPU context recovery were implemented but not forced during this playtest.