A simple python implementation of the A* (a-star) path finding algorithm. The source contains the algorithm and a simple proof-of-concept example using pygame.
The code only implements support for a plain square map but it should be fairly simple to implement support for any map type. If you have any questions regarding this don't hesitate to ask.
Edit the map by first selecting a tile type. The blocking tiles can not be passed. The walkable tiles has values from 1-4 (also known as move cost) where 1 represents easy terrain (low cost) and 4 is rough terrain (high cost). You can also place the start and ending points.
When you are finished editing press the Find path button and the AStar algorithm will try to find the path with the lowest cost. If any path is found it will be displayed with white lines.
- AStar_v1.1.tar.gz - Current version.
Both the AStar implementation and the example code is public domain.
Comment this project:
Steven Zhou 2011-08-07 05:06:15 Steven Zhou 2011-08-07 04:17:45 Steven Zhou 2011-08-07 04:05:02 Steven Zhou 2011-08-07 04:01:05 Tiersen 2011-02-27 21:18:35 View all