setWalkableAt method

dynamic setWalkableAt(
  1. dynamic x,
  2. dynamic y,
  3. dynamic walkable
)

Set whether the node on the given position is walkable. NOTE: throws exception if the coordinate is not inside the grid. @param {number} x - The x coordinate of the node. @param {number} y - The y coordinate of the node. @param {boolean} walkable - Whether the position is walkable.

Implementation

setWalkableAt(x, y, walkable) {
  this.nodes[y][x].walkable = walkable;
}