A modern recreation of the 2048 puzzle game, built using Next.js App Router, TypeScript, and TailwindCSS.
Fast, minimal, and responsive — experience the classic logic challenge with a fresh look.
🔗 Live Demo: https://2048-oyunu.vercel.app
- ⚡ Next.js App Router (v13+)
- 🧠 TypeScript type-safety
- 🎨 TailwindCSS responsive design
- 🎮 Keyboard & touch support
- 💾 Local score saving (via localStorage)
- 🔁 Restart & Undo functionality
- 🌙 Optional Dark Mode
| Layer | Technology |
|---|---|
| Framework | Next.js 15 |
| Language | TypeScript |
| Styling | TailwindCSS |
| Router | App Router |
| Hosting | Vercel or custom server |
Clone the repository:
git clone https://github.com/slipbey/2048-game.git
cd <repo>Install dependencies:
npm install
# or
yarn installRun the development server:
npm run devThen open your browser at:
http://localhost:3000
src/
├── app/
│ ├── page.tsx → Main game page
│ ├── layout.tsx → App layout
│ └── globals.css → Tailwind global styles
├── features/game/
│ ├── Game2048.tsx → Game board logic
│ ├── ScoreBoard.tsx → Score display
│ ├── LoseOverlay.tsx → Game over overlay
│ ├── SizeSelector.tsx → Grid size selection
│ └── index.ts → Game exports
├── lib/ → Utilities and helpers
└── ui/ → Reusable UI components
| Key | Action |
|---|---|
| ⬆️ | Move Up |
| ⬇️ | Move Down |
| ⬅️ | Move Left |
| ➡️ | Move Right |
| R | Restart |
The full 2048 logic (merge, movement, new tile generation, and win/loss detection)
is implemented from scratch using a pure React + TypeScript state system.
Everything is written with maintainability and performance in mind.
Contributions are welcome! 🎉
GPL-3.0 license © 2025 — Created by Slipbey
Feel free to use, modify, and distribute with attribution.
