A browser-based implementation of the popular 2048 puzzle game. Players combine numbered tiles on a 4×4 grid to reach the coveted 2048 tile through strategic moves and tile merging.
This is a web-based version of the classic 2048 game where players slide numbered tiles on a grid to combine them and create a tile with the number 2048. The game features responsive design, and intuitive controls using arrow keys or swipe gestures.
- HTML5 - Structure and layout
- CSS3 - Styling and animations
- JavaScript (ES6) - Game logic and interactivity
- GitHub Pages - Deployment
Follow these instructions to get the project running locally on your machine.
- Node.js (version 14 or higher)
- npm or yarn package manager
-
Clone the repository:
git clone https://github.com/ivsasha/2048-game.git cd 2048-game -
Install dependencies:
npm install # or yarn install -
Run the project locally:
npm start # or yarn start
The game will be available at http://localhost:3000 (or the port specified in your configuration).
- Responsive Design - Optimized for both desktop and mobile devices
- Score Tracking - Keep track of your current and best scores
- Game State Management - Win/lose detection with restart functionality
- Keyboard Controls - Use arrow keys for precise tile movement
- Use arrow keys (↑↓←→) to move tiles in the desired direction
- When two tiles with the same number touch, they merge into one
- Try to create a tile with the number 2048 to win
- The game ends when you can't make any more moves
2048-game/
├── src/
│ ├── index.html
│ ├── styles/
│ ├── scripts/
│ └── images/
├── package.json
└── README.md