A browser-based implementation of the classic 2048 puzzle game built with JavaScript. Combine tiles to reach the magic number—2048—while honing your strategy and enjoying a smooth, interactive UI.
- Goal: Slide numbered tiles on a 4x4 grid to combine them into a tile with the value of 2048.
- How to Play: Use arrow keys to move tiles. Tiles with the same value merge, creating a new tile with double the value. Keep combining tiles until you reach 2048—or run out of moves!
- Win/Loss: Win by reaching 2048. The game is over when no valid moves remain.
- Smooth Gameplay: Intuitive controls and animations for a satisfying player experience.
- Responsive Design: Works well across devices and screen sizes.
- Random Tile Generation: After each move, a new tile (2 or 4) spawns randomly, adding challenge.
- Scoring System: Tracks your score with each move, encouraging higher scores.
- Restart Option: Reset the board at any time with a click of a button.
src/modules/Game.class.js
: Core game logic and mechanics, including tile merging and move validation.src/index.html
: Main layout and structure for the game interface.main.js
: Connects UI elements with game logic and manages event handling.
- JavaScript: Game logic and interactions
- HTML & CSS: Responsive layout and styling
You can play the game here or clone this repository to try it locally.