Skip to content

A web implementation of the hit 2048 game where you have to combine tiles until you reach a specific number.

Notifications You must be signed in to change notification settings

yankostadinov/2048

Repository files navigation


2048

View Demo

Table of Contents
  1. About The Project
  2. Getting Started
  3. Config

About The Project

A web implementation of the hit 2048 game where you have to combine tiles until you reach a specific number.

(back to top)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

  1. Clone the repo
    git clone https://github.com/yankostadinov/2048.git
  2. Install NPM packages
    yarn
  3. Build and run the project
    yarn dev

You should now be able to load the game here: http://localhost:5173/2048/

(back to top)

Config

Edit src/config.js to configure different aspects of the game:

  • size: The square grid size. Size 6 creates a grid with 6 rows and 6 columns for a total of 36 tiles.
  • obstacles: Number of obstacles placed on the grid to increase difficulty by blocking the movement of tiles.
  • targetPower: The power of 2 that you must reach to win the game. A targetPower of 11 means you need to create a tile of value 2048.
  • keyboardShortcutsEnabled: Disables keyboard arrow shortcuts to move the tiles.
  • powerColors: Colors for different powers of tiles. Make sure to add more colors if increasing the targetPower.

(back to top)

Contact

Yan Kostadinov - [email protected]

(back to top)

About

A web implementation of the hit 2048 game where you have to combine tiles until you reach a specific number.

Resources

Stars

Watchers

Forks