Click on tiles to change state (light=floor , dark=wall) Drag from the box on the left to move target Press/Hold "Space" to spawn agents Use "Display Pathfinding?" to control if you want to see the pathfinding (lighter blue=close to target , darker blue=far from target)
The pathfinding does do a bit lag spike when doing it The agents tend to stick near walls and sometimes get stuck? If you want me to make a version that is more commented and backpackable / clean comment HOW IT WORKS: 1.Set the tile the target is at to value 0 2.Start on that tile 3.Set neighboring tiles to 1 greater value if not wall/off grid 4.Add tiles to to-do list 5.Remove tile just done from to-do list 6.Repeat at step 3 with next tile in list until list empty When agent wants to move check surrounding tiles for a tile with lower value (closer to target) and move that way