Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

2048-tea

This project is a Node.js implementation of the popular game 2048. It includes the core game logic for initializing the game board, adding new tiles, sliding and merging tiles based on player input, and checking for game over conditions.

Published14 Mar 2024
Direct dependencies2
Transitive dependenciesNot calculated

README

Current package documentation

2048 Game in Node.js

This project is a Node.js implementation of the popular game 2048. It includes the core game logic for initializing the game board, adding new tiles, sliding and merging tiles based on player input, and checking for game over conditions.

Features

  • Initialize a 4x4 game board.
  • Randomly add new tiles (2 or 4) to the board.
  • Slide and merge tiles when the player inputs a direction (up, down, left, right).
  • Check for game over condition.
  • Console-based UI to play the game in a terminal.

Installation

To run this project, you will need Node.js installed on your system. If you don't have Node.js installed, you can download it from Node.js website.

Once Node.js is installed, clone the repository to your local machine:

npm install

git clone https://github.com/JerryXun0311/2048-tea.git
cd 2048-nodejs

How to Play

node src/game.js

Use the following keys to move the tiles:

W or w for UP S or s for DOWN A or a for LEFT D or d for RIGHT After each move, a new tile (2 or 4) will appear randomly on the board. The goal is to combine tiles with the same numbers to increase their value and try to reach the 2048 tile.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^29.7.0development
puppeteer
Environment
{
  "local_name": "puppeteer",
  "alias": false,
  "peer_metadata": null
}
^22.4.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-csCVDRXA0CQFGKLsJ80wpmNk8+IT2W3noEAeZ+T4wihZtVb+fxtJdmzH8Gao5Qg3CUDVypXg9LHtj1bRqon74g==",
  "shasum": "7404dfe6cef2b8dc83b75e3dafaf2f55ea6edd63",
  "tarball": "https://registry.npmjs.org/2048-tea/-/2048-tea-1.0.0.tgz",
  "fileCount": 5,
  "unpackedSize": 4876,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCE0mp7xCiw2DWEus0DcBC3OrSg7CcAcNyEHRlwNd5zJwIhAPvw6rPEYlCptxOTISiFaI7h5mxzMblxIqppB5yMUJcS"
    }
  ]
}

Repository

PENDING
jerryxun0311/2048-tea

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:55 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:288323b112ae16a8f1be2b83a23a1e2b518bc806bf23f8fdba45edfd89bf6eaa

Other collected versions

View all collected versions →