Skip to content

ivsasha/2048-game

Repository files navigation

2048 Game

A browser-based implementation of the popular 2048 puzzle game. Players combine numbered tiles on a 4×4 grid to reach the coveted 2048 tile through strategic moves and tile merging.

📋 Project Description

This is a web-based version of the classic 2048 game where players slide numbered tiles on a grid to combine them and create a tile with the number 2048. The game features responsive design, and intuitive controls using arrow keys or swipe gestures.

🛠 Technologies Used

  • HTML5 - Structure and layout
  • CSS3 - Styling and animations
  • JavaScript (ES6) - Game logic and interactivity
  • GitHub Pages - Deployment

🚀 Getting Started

Follow these instructions to get the project running locally on your machine.

Prerequisites

  • Node.js (version 14 or higher)
  • npm or yarn package manager

Installation

  1. Clone the repository:

    git clone https://github.com/ivsasha/2048-game.git
    cd 2048-game
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Run the project locally:

    npm start
    # or
    yarn start

The game will be available at http://localhost:3000 (or the port specified in your configuration).

✨ Key Features

  • Responsive Design - Optimized for both desktop and mobile devices
  • Score Tracking - Keep track of your current and best scores
  • Game State Management - Win/lose detection with restart functionality
  • Keyboard Controls - Use arrow keys for precise tile movement

🎯 How to Play

  1. Use arrow keys (↑↓←→) to move tiles in the desired direction
  2. When two tiles with the same number touch, they merge into one
  3. Try to create a tile with the number 2048 to win
  4. The game ends when you can't make any more moves

📁 Project Structure

2048-game/
├── src/
│   ├── index.html
│   ├── styles/
│   ├── scripts/
│   └── images/
├── package.json
└── README.md

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors