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 |
Methods
compare(other) → {number}
This is used internally by the pathfinding algorithm
Parameters:
Name | Type | Description |
---|---|---|
other |
Node |
Another node to compare the cost |
equals(other) → {boolean}
This is used internally by the pathfinding algorithm
Parameters:
Name | Type | Description |
---|---|---|
other |
Node |
Another node to compare the equality |