selimanac / defold-astar

Pathfinder and A* solver (astar or a-star) native extension for Defold Engine build on MicroPather.
https://selimanac.github.io/
80 stars 5 forks source link

Solve method requires start index at zero #1

Closed KorolevSoftware closed 6 months ago

KorolevSoftware commented 3 years ago

Hello! I use astar for sokoban game. I must to subtract one for start position and target position for search path and must add one by everyone path point for use in transform. astar.solve(player_position.x - 1, player_position.y - 1, target.x - 1, target.y - 1) new_position = {path.x + 1, path.y + 1} I thinks good practice convert start index at one, like lua.

selimanac commented 6 months ago

Added v1.0.2