# game-grid

> Reusable grid model and grid canvas view for 2D board games.

Latest version **0.0.9** (published 2014-05-04) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install game-grid
pnpm add game-grid
yarn add game-grid
bun add game-grid
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2014-05-04 |
| First published | 2014-04-25 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Andrey Marushkevych |
| Maintainers | marushkevych |
| Keywords | grid, canvas, javascript, games |

## Links

- npm: https://www.npmjs.com/package/game-grid
- Repository: https://github.com/marushkevych/game-grid
- Issues: https://github.com/marushkevych/game-grid/issues
- npm.io page: https://npm.io/package/game-grid

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) ~1.6.0

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 0.0.9 (latest) — 2014-05-04
- 0.0.8 — 2014-05-02
- 0.0.7 — 2014-04-30
- 0.0.6 — 2014-04-28
- 0.0.5 — 2014-04-28
- 0.0.4 — 2014-04-28
- 0.0.3 — 2014-04-26
- 0.0.2 — 2014-04-26
- 0.0.1 — 2014-04-25
- 0.0.0 — 2014-04-25

## README

game-grid
============

Reusable grid model and grid canvas view for 2D board games.

This initial version contains basic canvas grid view and model able to identify cell neighbors.
See http://github.com/marushkevych/game-of-life for usage examples.

```js
var grid = require('game-grid');
var canvas = document.getElementById("canvas");

var view = new grid.GridView(canvas, {size: 10, scale: 7});
var model = new grid.GridModel(10);

view.onCellClick(function(cell) {
    var modelCell = model.getCell(cell.x, cell.y);
    // react to cell click
});

view.paintGrid();
```

---
_Source: https://npm.io/package/game-grid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
