1681-engine / index / canStep
Function: canStep() ​
ts
function canStep(
g,
cx,
cy,
dx,
dy,
endOnly,
isGoal
): boolean;Defined in: src/nav/navGrid.ts:73
May a body step from (cx, cy) by (dx, dy)? The tile must be open and, when it is end-only, be the goal; a diagonal may not cut the corner between two walls, nor brush an end-only tile on the way past.
Parameters ​
| Parameter | Type |
|---|---|
g | NavGrid |
cx | number |
cy | number |
dx | number |
dy | number |
endOnly | ((tx, ty) => boolean) | undefined |
isGoal | (tx, ty) => boolean |
Returns ​
boolean