This project is an implementation of the famous 2048 game using HTML, CSS, and JavaScript. It allows players to merge tiles to reach the number 2048 using arrow keys or touch gestures.
๐ Features
โ Responsive interface for both mobile and desktop. โ Tile movement via keyboard (arrows) and touch (swipe) โจ. โ Score and timer display during the game โณ. โ Visual effects and CSS animations for a better experience ๐จ. โ Pause โธ and Retry ๐ buttons. โ Victory message disappears after 10 seconds so that the user can continue playing ๐.
๐ File Structure
/2048-Game
โ-- index.html # Homepage
โ-- game.html # Game page
โ-- style.css # Styles and animations
โ-- script.js # Visual effects (stars, etc.)
โ-- game.js # Game logic (movements, merging, scoring...)
โ-- switch-150130.mp3 # Movement sound effect
|-- game-start-6104.mp3 # Start sound effect
โ-- README.md # Project documentation
๐ฎ How to Play?
-
Launch the game by opening index.html in a browser ๐
-
Use arrow keys โฌ๏ธโฌ๏ธโฌ ๏ธโก๏ธ or swipe on mobile ๐ฑ
-
Merge tiles to reach 2048 ๐ฏ
-
Win by reaching 2048! Otherwise, try again ๐