npm i pathfinding.ts
Finders:
- Jump Point - No Diagonal Movement
Jump point: 10
const grid = new Grid([
[50, 55, 60, 65, 70],
[45, 0, 0, 0, 75],
[40, 0, 0, 0, 1 ],//x4y2
[35, 0, 0, 0, 5 ],
[30, 25, 20, 15, 10],
]);
grid.findPath(
{ x: 4, y: 2 },
{ x: 4, y: 1 },
10,
FinderEnum.JUMP_POINT
);
[
{ x: 4, y: 2 },
{ x: 4, y: 4 },
{ x: 0, y: 4 },
{ x: 0, y: 0 },
{ x: 4, y: 0 },
{ x: 4, y: 1 }
]
grid.findPath(
{ x: 4, y: 2 },
{ x: 4, y: 1 },
1
);
[ ]
grid.findPath(
{ x: 4, y: 2 },
{ x: 4, y: 1 },
85
);
[
{ x: 4, y: 2 },
{ x: 4, y: 1 }
]