Methods
# getField(vec) → {GridField}
Get the field at a position.
Parameters:
Name | Type | Description |
---|---|---|
vec |
Vec2
|
The 2d vector of the position. |
The grid field.
# getNeighbors(vec) → {Array.<GridField>}
Get reachable neighbors for a position
Parameters:
Name | Type | Description |
---|---|---|
vec |
Vec2
|
The position to find the neighbors for. |
The list of neighbors.
Array.<GridField>
# insideBorders(vec) → {boolean}
decide whether a position lies inside the grid borders.
Parameters:
Name | Type | Description |
---|---|---|
vec |
Vec2
|
The position. |
Whether a position lies inside the borders.
boolean
# isWall(vec) → {boolean}
Whether the position is a wall.
Parameters:
Name | Type | Description |
---|---|---|
vec |
Vec2
|
The position. |
boolean