Welcome to the 2048 Game project! This is a web-based implementation of the popular 2048 puzzle game, created using React and styled with Tailwind CSS. The game features a sleek dark mode interface, optimized for both desktop and mobile devices.
2048 is a single-player sliding tile puzzle game. The objective of the game is to slide numbered tiles on a grid to combine them and create a tile with the number 2048.
- Dark mode interface for a sleek and modern look
- Smooth animations for tile appearance and merging
- Keyboard and touch controls for an optimized gaming experience on both desktop and mobile
- Score tracking with best score saving in local storage
- Responsive design for seamless play on various devices
To set up the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/pawantech12/2048-game-using-reactjs.git
cd 2048-game-using-reactjs-master
- Install the dependencies:
npm i or npm install
- Start the development server:
npm run dev
- Open your browser and navigate to http://localhost:5173
- Use the arrow keys on your keyboard to move the tiles.
- On mobile devices, swipe in the direction you want to move the tiles.
- Combine tiles with the same number to merge them and increase their value.
- The game ends when there are no possible moves left or when you create a tile with the number 2048.
- The game is played on a 4x4 grid.
- Each turn, a new tile (2 or 4) randomly appears in an empty spot on the board.
- Slide tiles using the arrow keys (or swipe on mobile) to move all tiles in the chosen direction.
- When two tiles with the same number collide, they merge into one tile with the sum of their values.
- The goal is to create a tile with the number 2048, but you can continue playing to achieve higher scores.
Contributions are welcome! To contribute to the project:
- Fork the repository.
- Create a new branch with a descriptive name:
git checkout -b feature/new-feature
- Make your changes and commit them with clear messages:
git commit -m "Add new feature"
- Push your branch to your fork:
git push origin feature/new-feature
- Open a pull request detailing your changes.
The original 2048 game was created by Gabriele Cirulli. This project is a recreation using modern web technologies.
If you have any questions or feedback, feel free to reach out to the project maintainer:
- Name: Pawan Kumavat
- Email: pawankumavat042@gmail.com
- GitHub: pawantech12
Enjoy playing the 2048 Game! 🚀