ig.

PathNode

new PathNode()

Node used in pathfinding calculations.

Source:

climbable :Boolean

Whether node is climbable.
- set automatically by tile check

Default Value:
  • false
Source:

corner :Boolean

Whether node is on a corner.
- set automatically by tile check

Default Value:
  • false
Source:

cornerMap :Object

Corners by name.

Source:

directNeighbors :Array

Walkable direct neighbors of node.

Default Value:
  • null
Source:

gridX :Number

Node grid x index.

Default Value:
  • 0
Source:

gridY :Number

Node grid y index.

Default Value:
  • 0
Source:

insideLevel :Boolean

Whether node is inside the level based on whether node position is inside ig.GameExtended#shapesLevel.

Default Value:
  • true
Source:

neighborMap :Object

Neighbors, walkable or otherwise, by direction.

Properties:
Name Type Description
top
bottom
left
right
topleft
topright
bottomleft
bottomright
Source:

neighbors :Array

Walkable neighbors of node, including direct and diagonal.

Default Value:
  • null
Source:

oneWay :Boolean

Whether node is one way.
- set automatically by tile check

Default Value:
  • false
Source:

oneWayFacing :Vector2|Object

Facing direction of one way.
- set automatically by tile check

Default Value:
  • 0 x 0
Source:

size :Number

Node size.

Default Value:
  • 0
Source:

sloped :Boolean

Whether node is sloped.
- set automatically by tile check

Default Value:
  • false
Source:

slopedAlong :Boolean

Whether node is along a smooth slope.
- set automatically by tile check

Default Value:
  • false
Source:

slopedNeighbor :Boolean

Whether node is next to a node that is sloped.
- set automatically by tile check

Default Value:
  • false
Source:

slopedNeighborMap :Object

Map of neighbors that are sloped.
- set automatically by tile check

Source:

slopeNormal :Object

Normal of slope if node is sloped.
- set automatically by tile check

Source:

slopesAlongMap :Boolean

Map of smooth slopes node is along. Currently only supports left and right.
- set automatically by tile check

Source:

tile :Number

Id of tile node corresponds to.

Default Value:
  • 0
Source:

ungrounded :Boolean

Whether node is likely in the air / ungrounded.

Default Value:
  • true
Source:

walkable :Boolean

Whether node is walkable.

Default Value:
  • true
Source:

weight :Number

Weight value between 0 and infinity.

Default Value:
  • 0
Source:

weightPct :Number

Weight percent between 0 and 1, where 0 is best, 0.5 is neutral, and 1 is worst.
- this controls the how much of the modifiers applied to the weight by ig.pathfinding.WEIGHT

Default Value:
  • 1
Source:

x :Number

Node world x position.

Default Value:
  • 0
Source:

y :Number

Node world y position.

Default Value:
  • 0
Source:

cleanup()

Cleans node after use.
- this method is called after each pathfinding on only nodes that were used

Source:

init(x, y, gridX, gridY, walkable, tile, settings)

Initializes a node for pathfinding.

Parameters:
Name Type Argument Default Description
x Number world x
y Number world y
gridX Number grid x index
gridY Number grid y index
walkable Boolean <optional>
true
tile Number <optional>
0
settings Object <optional>
Source: