Dijkstra Pathfinding Toy

This is a simple implementation of the Dijkstra pathfinding algorithm with visualization.  Click on a non-red square and the pathfinding output will be displayed.  Green tiles are ones that have been visited by the algorithm, and blue squares represent the path found.  The little sprite will then travel along the path.  :3  You can also select the A* algorithm to see how it is often far more efficient than Dijkstra.

Press ESC to show a toggle switch allowing you to see the pathfinding animation unfold, and to select whether to use Dijkstra or A*. Right-click to clear the path.

Made in Godot 3.4.4.  While Godot has pathfinding built in, I wanted to write this as an exercise in implementing the algorithm and learning to use some basic Godot features.  😊

Leave a comment

Log in with itch.io to leave a comment.