This project is a JavaScript implementation of the popular game 2048. In this game, players combine tiles of the same number to reach the tile with the number 2048. The game is played on a 4x4 grid, where each move slides all tiles in one of four directions (up, down, left, right). When two tiles of the same number collide while moving, they merge into a tile with the total of their numbers. The goal is to create a tile with the number 2048.
- JavaScript (ES6+): The main language used for the game logic, including classes and modules.
- HTML & CSS: For structuring and styling the game interface.
You can view a live preview of the game here.
To get a local copy of the game up and running, follow these steps:
- Make sure you have Node.js installed on your system.
- Clone the repository:
git clone https://github.com/srtrace/2048-game.git cd 2048-game
- Install dependencies:
npm install
-
Open the project in your preferred editor.
-
Run the game:
- Since the game is built with JavaScript modules, you can open the
index.html
file directly in a browser to play.
- Since the game is built with JavaScript modules, you can open the