Catalog npm
PACKAGE EXPLORERView in registry

2048-tea

npm

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.

Versions collected1
Direct dependencies2From release 1.0.0
Last observed20 Oct, 18:55 UTC

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.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest14 Mar 20242

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

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:ba06f392775b851dde07723ab708fdd8f9583e69c42e9eca0a587c3adf5b910e