Table of Contents
A web implementation of the hit 2048 game where you have to combine tiles until you reach a specific number.
To get a local copy up and running follow these simple example steps.
- Clone the repo
git clone https://github.com/yankostadinov/2048.git
- Install NPM packages
yarn
- Build and run the project
yarn dev
You should now be able to load the game here: http://localhost:5173/2048/
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.
Yan Kostadinov - [email protected]