polyomino-engine
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Polyomino Engine

A very simple game engine for generic polyomino line clearning puzzle games.

Installation

import * as poly from "polyomino-engine";

Usage

  • create: create a new a game instance
  • drop: hard drop the cursor piece
  • floating: detect if the cursor piece is floating or not
  • move: moves the cursor piece, returns false if operation fails
  • predict: predict the y of the cursor piece if it was dropped
  • print: print the cursor piece onto the board
  • rotate: rotate the cursor piece, returns false if operation fails
  • spawn: spawns a piece using the available spawn locations, returns false if operation fails
  • verify: verifies if the current board and cursor are valid
  • clear: clears the filled lines and returns an array of line numbers

Please refer to src/types for more information on the internal types or use intellisense.

Readme

Keywords

none

Package Sidebar

Install

npm i polyomino-engine

Weekly Downloads

5

Version

0.0.3

License

none

Unpacked Size

17.4 kB

Total Files

40

Last publish

Collaborators

  • weisrc