Skip to content

SlipBey/2048-game

Repository files navigation

🎮 2048 Game — Next.js + TypeScript + TailwindCSS

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


🚀 Features

  • 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

🛠️ Tech Stack

Layer Technology
Framework Next.js 15
Language TypeScript
Styling TailwindCSS
Router App Router
Hosting Vercel or custom server

📦 Installation

Clone the repository:

git clone https://github.com/slipbey/2048-game.git
cd <repo>

Install dependencies:

npm install
# or
yarn install

Run the development server:

npm run dev

Then open your browser at:

http://localhost:3000

🧩 Project Structure

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

🎯 Controls

Key Action
⬆️ Move Up
⬇️ Move Down
⬅️ Move Left
➡️ Move Right
R Restart

🧠 Developer Notes

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! 🎉


📸 Preview

2048 Game Screenshot


📄 License

GPL-3.0 license © 2025 — Created by Slipbey
Feel free to use, modify, and distribute with attribution.


👨‍💻 Author

SlipBey
DiscordLinkedInWebsite

About

Modern 2048 puzzle game built with Next.js, TypeScript, and TailwindCSS — fast, responsive, and open source.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published