A visual implementation of the A* pathfinding algorithm.
I created this pathfinding program using Python and Pygame. The program launches a window that contains a grid of nodes. A user can select a starting node and an ending node. They can also place barriers on the grid. The pathfinding algorithm will then find the shortest path between the two nodes and visualy show each step.
- Download the python file
- Make sure you have Python and Pygame installed: https://www.pygame.org/wiki/GettingStarted
- Open a terminal in the same directory as the file and run the command:
py astar.py
- Click on a spot in the grid to create a start point
- Click on another spot to create an end point
- Hold down the left mouse button and draw barriers
- Use the right mouse button to delete barriers or the start/end points
- Press SPACEBAR to start the pathfinding algorithm
- Press C to clear the grid