Node

PhaserPathfinding. Node

The Node class represents a node in the grid, normally you don't need to use this one, usually the pathfinding algorithm will return a PathNode

Constructor

new Node(walkable, x, y, width, height)

Parameters:
Name Type Description
walkable boolean

If false the node is an obstacle

x number

The x position in tile unit

y number

The y position in tile unit

width number

The width of the tile in px

height number

The height of the tile in px

Properties:
Name Type Description
x number

The x position in tile unit

y number

The y position in tile unit

worldX number

Only exists on the nodes returned by the pathfinding algorithm and represents the x position in pixels

worldY number

Only exists on the nodes returned by the pathfinding algorithm and represents the y position in pixels

width number

The width of the tile in px

height number

The height of the tile in px

walkable boolean

If false the node is an obstacle

Source:

Methods

compare(other) → {number}

This is used internally by the pathfinding algorithm

Parameters:
Name Type Description
other Node

Another node to compare the cost

Source:

equals(other) → {boolean}

This is used internally by the pathfinding algorithm

Parameters:
Name Type Description
other Node

Another node to compare the equality

Source: