GameboardCoordinateSystem
Defined in: src/coordinates/grid.ts:81
Convenience surface for KayKit-compatible coordinate math.
Properties
Section titled “Properties”distance
Section titled “distance”distance: (
left,right) =>number
Defined in: src/coordinates/grid.ts:93
Computes axial hex distance between two coordinates.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
findPath
Section titled “findPath”findPath: (
start,goal,options?) =>HexPathResult
Defined in: src/coordinates/grid.ts:95
Finds a path between two coordinates using the shared pathfinding helper.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”fromWorld
Section titled “fromWorld”fromWorld: (
position) =>HexCoordinates
Defined in: src/coordinates/grid.ts:89
Converts a world X/Z position to the nearest axial coordinate.
Parameters
Section titled “Parameters”position
Section titled “position”Pick<WorldPosition, "x" | "z">
Returns
Section titled “Returns”geometry
Section titled “geometry”geometry:
HexGeometry
Defined in: src/coordinates/grid.ts:83
Geometry used by all conversions in this coordinate system.
neighbors
Section titled “neighbors”neighbors: (
coordinates) =>HexCoordinates[]
Defined in: src/coordinates/grid.ts:91
Returns the six axial neighbors around a coordinate.
Parameters
Section titled “Parameters”coordinates
Section titled “coordinates”Returns
Section titled “Returns”rowSpacing
Section titled “rowSpacing”rowSpacing:
number
Defined in: src/coordinates/grid.ts:85
Z-axis spacing between adjacent hex rows.
spawnLocations
Section titled “spawnLocations”spawnLocations: (
options) =>SpawnLocation[]
Defined in: src/coordinates/grid.ts:97
Selects deterministic spawn locations and projects them into world space.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”toWorld
Section titled “toWorld”toWorld: (
coordinates,elevation?) =>WorldPosition
Defined in: src/coordinates/grid.ts:87
Converts an axial coordinate and optional elevation into world space.
Parameters
Section titled “Parameters”coordinates
Section titled “coordinates”elevation?
Section titled “elevation?”number