2048 is a classic single-player sliding puzzle game where the player combines tiles to reach the 2048 tile. The game starts with two tiles, each with a value of 2 or 4. The player can slide the tiles in four directions - up, down, left, or right, and all tiles on the board move in that direction. When two tiles with the same value collide, they merge into one, doubling the value. The goal is to reach the 2048 tile and achieve the highest score possible.
- HTML: Employed for structuring the content of the landing page.
- CSS: Used for styling and layout, ensuring an aesthetically pleasing design.
- SCSS: Utilized for enhanced stylesheet authoring, providing features like variables, nested rules, and mixins.
- JavaScript: The game logic and interactivity are implemented using JavaScript.
- GitHub Pages: Hosted on GitHub Pages for easy access and sharing.
You can play the game online GAME LINK
- Combine identical tiles to create a new tile with the sum of the two combined values.
- The ultimate objective is to reach the 2048 tile by strategically combining tiles.
- Tile Movement:
- Swipe on the game board (up, down, left, or right) to move all the tiles in that direction.
- All tiles will move as far as possible in the chosen direction.
- Tile Combination:
- Tiles with the same number will combine when they collide after a move. For example, if two tiles with the number 2 collide, they will combine to create a single tile with the number 4.
- Tile Generation:
- After each move, a new tile with a value of 2 or 4 will appear on an empty spot on the board.
- Strategy:
- Plan your moves strategically to keep the highest-value tiles in one corner.
- Focus on building up to the 2048 tile by combining tiles in a systematic manner.
- Game Over:
- The game ends when there are no more moves possible, and the board is full.
- The score is the sum of all the tiles on the board.
- Tips: Plan, be patient, and learn from mistakes. Enjoy!
To play the game locally, follow these steps:
-
Clone the repository git clone https://github.com/nataliiahen/js_2048_game.git
-
Navigate to the project directory cd js_2048_game
-
Open the game in your default web browser open index.html in your preferred web browser.
Start playing by using the arrow keys (up, down, left, right) to slide the tiles.