npm install hexgridA hexagonal grid layout. This prototype is flexible abstraction layer for hexagaonal grids.
``js`
npm install hexgrid --save
Uses axial/trapezoidal coordinate space with pointy-top hexagons
- Increasing x goes right
- Increasing y goes bottom right
`js
// Init the hexgrid
var Hexgrid = require('hexgrid');
var grid = new Hexgrid({
size: 20
});
// Add a hexagon cell
var firstCellPoint = new Point(1, 2);
var firstCell = new Hexcell(firstCellPoint);
grid.add(firstCell);
`
$3
Gets a hexcell at point2d$3
Gets the calculated x and y (based on the hexagonal grid) of a point$3
Returns true if there is no hexcell at point2d`