All of the pieces for our path-finding implementation are ready now. Our next step is to bind them all together into a module that can determine the shortest path when traveling "on foot" through our virtual environment.
The walker module will specify which neighbor and heuristic functions need to be used with the algorithm.
The module will therefore need to load the path module so that it can call our A* function.
local path = require "path"
local function manhattan(space, goal)
We've given the A* algorithm a particular case to work on, by choosing functions that provide it with neighbors and a heuristic for a specific kind of map. If we wanted to create a flying or swimming creature, we would need to replace the neighbors
function to modify the costs for obstacle spaces or areas of water.
3.143.9.115