Skip to content

mpohorenyi/2048-Game

Repository files navigation

Welcome to 2048 - Game 👋

HTML5 CSS3 SASS JavaScript


Logo

2048 game implemented in JavaScript

View Demo

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

About The Project

2048-Game

This project appears to be a JavaScript implementation of the game 2048. The 2048 game is a single-player sliding block puzzle game. The game's objective is to slide numbered tiles on a grid to combine them to create a tile with the number 2048.

Here's a brief description of the project structure:

game.js: This file contains the logic for the game. It has a class Game with methods to move the tiles in all four directions (up, down, left, right), check if the game is over or won, add a new random cell, and reset the game. It also keeps track of the game score.

main.js: This file is responsible for interacting with the DOM. It uses the Game class from game.js to control the game based on the user's input. It also updates the game's visual representation on the web page based on the game state.

The project also seems to be implementing some animations for the game.

The game starts with two random cells, and the player can use the arrow keys to slide all the tiles in one direction. When two tiles with the same number touch, they merge into one with a number that is the sum of the two original numbers. A new random cell is added after each move. The game is won when a cell reaches the number 2048, and it's over when there are no empty cells and no adjacent cells with the same number.

Getting Started

To get a local copy up and running, follow these steps:

Prerequisites

Make sure you are using the correct version of the node

  • node 14.21.3

Installation

  1. Clone the repo
git clone https://github.com/mpohorenyi/MyBike-Landing-Page.git
  1. Install NPM packages
npm install

Usage

To start the project, use the following command:

npm start

Author

(UP)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published