It's my Lua pathfinder called Terra! (It's pronounced like Te-ha) And it's pretty easy to use, here's a tutorial:
First of all, you need to have a map and a player!
Code: Select all
MightyMap = {}
MightyMap[1] = {0, 1, 2}
MightyMap[2] = {0, 2, 0}
MightyMap[3] = {0, 3, 0}
player = {y = 1, x = 1}
Code: Select all
terra.setWalkableNodes{2, 3}
terra.setStartingNode(y, x)
terra.setTargetNode(y, x)
Code: Select all
path = terra.pathfind(MightyMap)
Code: Select all
step = 1
function love.update(dt)
player.y, player.x = path[step].y, path[step].x
step = step + 1
end
If you find any bugs, please tell me