Trying out A* Pathfinding

Pathfinding is an integral part of many top-down games, especially RTS games like Starcraft or Age of Empires, in which you tell a unit where to go, and it figures out the best way to get there itself, navigating around obstacles and unwalkable spaces.  A proven way of doing efficient and accurate pathfinding is using the A* search algorithm.  After doing some tutorials on C++ and SDL, I thought I’d give it a shot.  After getting some free-to-use art from http://opengameart.org/, I came up with the following:

Continue reading

Advertisements