Skip to content

@ue-too/board-game-engine / createHexGrid

Function: createHexGrid()

createHexGrid(coordinator, width, height, name, variant): number

Defined in: grid-system/hex-grid.ts:49

Creates a hexagonal grid with offset coordinates (q, r).

Parameters

coordinator

Coordinator

The ECS coordinator

width

number

The width of the grid (q dimension)

height

number

The height of the grid (r dimension)

name

string

The name of the grid

variant

HexGridVariant = 'odd-r'

The offset coordinate variant: 'odd-r', 'even-r', 'odd-q', or 'even-q'

Returns

number

The grid entity