Skip to content

DHRUVI5674/2048_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎮 2048 Game

A web-based implementation of the classic 2048 puzzle game built using HTML, CSS, and JavaScript. The goal is to merge tiles with the same numbers to reach the 2048 tile while achieving the highest possible score.


🚀 Features

  • 🎯 Interactive 4×4 grid gameplay
  • 🖱️ Drag / swipe controls for movement
  • 🔢 Tile merging with dynamic updates
  • 📊 Real-time score tracking
  • 🏆 Win and Game Over detection
  • 🎨 Clean and responsive UI
  • ⚡ Smooth tile animations

⚠️ Note

  • Arrow keys are currently not supported
  • ✅ Use mouse drag (desktop) or swipe gestures (mobile) to play the game

🛠️ Tech Stack

  • HTML5 – Structure
  • CSS3 – Styling and layout
  • JavaScript (ES6) – Game logic and interactions

🎮 How to Play

  1. Drag (⬆️ ⬇️ ⬅️ ➡️) on the grid to move tiles
  2. Merge tiles with the same number
  3. A new tile (2 or 4) appears after each move
  4. Reach 2048 to win 🎉
  5. Game ends when no moves are left

📁 Project Structure

2048-game/
│── index.html
│── style.css
│── script.js

🔧 Installation

git clone https://github.com/your-username/2048-game.git
cd 2048-game

Open index.html in your browser.


🌟 Future Improvements

  • ⌨️ Add keyboard (arrow key) support
  • 💾 High score saving (Local Storage)
  • 🎵 Sound effects
  • 🌙 Dark mode

📄 License

This project is licensed under the MIT License.

About

The 2048 Game is a simple and interactive sliding puzzle built using HTML, CSS, and JavaScript. Players combine matching numbered tiles on a 4×4 grid to reach the value 2048. The game uses keyboard controls for movement, updates the score in real time, and ends when no more moves are possible or the target tile is achieved.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors