Class engine.DirectPath
Computes a direct line path from start to end
Methods
engine.DirectPath:init (map, actor)
Initializes DirectPath for a map and an actor
engine.DirectPath:calc (sx, sy, tx, ty[, use_has_seen])
Compute path from sx/sy to tx/ty
Methods
- engine.DirectPath:init (map, actor)
-
Initializes DirectPath for a map and an actor
Parameters:
- engine.DirectPath:calc (sx, sy, tx, ty[, use_has_seen])
-
Compute path from sx/sy to tx/ty
Parameters:
- sx the start coord
- sy the start coord
- tx the end coord
- ty the end coord
- use_has_seen if true the astar wont consider non-has_seen grids (optional)
Returns:
-
nil if no path
Or
-
a list of nodes in the form { {x=...,y=...}, {x=...,y=...}, ..., {x=tx,y=ty}}