A* pathfinding algorithm with SDL2 visualization.
An interactive implementation of the A* pathfinding algorithm with real-time visualization using SDL2. Based on OneLoneCoder's tutorial, this project lets you create obstacles and watch the algorithm find optimal paths.
- Interactive node grid with clickable obstacles
- Adjustable start and end positions (Shift+click / Ctrl+click)
- Visual feedback showing searched nodes and final path
- Handles unreachable destinations gracefully
- macOS (tested on Catalina 10.15.4+)
- SDL2 (
brew install sdl2) - CMake 3.17+
- C++17 compiler
mkdir build && cd build
cmake ..
make./build/a-star/a-star| Action | Control |
|---|---|
| Add obstacle | Click on node |
| Move start | Shift + Click |
| Move end | Ctrl + Click |
Tests are not yet implemented.
CC0 1.0 Universal - see LICENSE
Rich Nistuk - rnistuk
- javidx9 OneLoneCoder - A* tutorial video
- A* on Wikipedia