Flash demonstration of A* pathfinding.

Drag the green dot (starting point) and red dot (end) where you want, then hit "find path".

The movie will then step through the A* algorithm and you can watch how it chooses the "best" path. Exciting!

In most computer games, the algorithm runs in the background, and once a path is found it just appears on the map or the unit starts moving. Here the algorithm is much slower, so you can watch it at work.

You can select a terrain type at the bottom and draw it onto the board. Trees (green) have a movement penalty of .5, swamps (blue) have a penalty of 2.

You can download the source files for this movie. Go ahead, take a look.