Welcome to 2048, a web-based clone of the popular sliding puzzle game built with React, Vite, and TypeScript.
Check out the live demo of the 2048 game here.
- Keyboard and touch support
- Keeps track of high scores
- Simple and intuitive design
- Frontend Framework: React (with Vite)
- Language: TypeScript
- Styling: CSS
- Build Tool: Vite
-
Clone the repository:
git clone https://github.com/yourusername/2048-game.git
-
Navigate to the project directory:
cd 2048-game
-
Install dependencies:
pnpm install
To start the development server, run:
pnpm run dev
The app will be available at http://localhost:5173
.
To create a production build, run:
pnpm run build
Here are some screenshots from the game:
The goal of the game is to slide numbered tiles on a grid to combine them and create a tile with the number 2048.
- Controls: Use the arrow keys (or swipe on mobile devices) to slide the tiles.
- Combine Tiles: When two tiles with the same number collide, they merge into one.
- Win Condition: You win when you create a 2048 tile.
- Lose Condition: The game ends when no more moves are possible.
Contributions are welcome! If you'd like to make improvements, please:
- Fork the project.
- Create a new feature branch (
git checkout -b feature/my-feature
). - Commit your changes (
git commit -m 'Add my feature'
). - Push to the branch (
git push origin feature/my-feature
). - Open a pull request.