Lua中的A*寻路算法
一般用法:
local mapGenerator = require ' map '
local mapSolver = require ' mapSolver '
local map = mapGenerator {
width = 25 ,
height = 25 ,
entry = {x = 15 , y = 7 },
exit = {x = 23 , y = 11 },
}
-- generate a map
map. generate ()
-- prepare map pathfinding solver
local solver = mapSolver (map)
local solve = solver. solve ()
local validPath
local solver = mapSolver (map)
local solve
2021-08-16 00:18:12
24KB
Lua
1