Skip to content

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 ​

ParameterType
gNavGrid
cxnumber
cynumber
dxnumber
dynumber
endOnly((tx, ty) => boolean) | undefined
isGoal(tx, ty) => boolean

Returns ​

boolean

Released under the MIT License.