mykulyak-2048
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

2048

Logic for 2048-like games.

Usage

import Game, { Direction } from '@mykulyak/2048';

// 1. create game
const game = Game.create({ size: 4, bricksPerStep: 1 });

// 2. make moves
game.slide(Direction.North);
game.slide(Direction.West);
game.slide(Direction.South);
game.slide(Direction.East);

// 3. check game status
if (game.gameOver) {
  // ... do something ...
}

// 4. reset game

Readme

Keywords

Package Sidebar

Install

npm i mykulyak-2048

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

80.2 kB

Total Files

22

Last publish

Collaborators

  • mykulyak