[pygame] A* pathfinding demo

This is the place to post any code that you want to share with the community. Only completed scripts should be posted here.
Note: posts here are not necessarily endorsed by the community, and may represent amateur or even bad practices.

[pygame] A* pathfinding demo

Postby Mekire » Mon Jun 24, 2013 2:46 am

I recently recoded this program from scratch. It is just a demo showing the A* algorithm. Users can choose from three types of agent movement (rook, queen, and knight), and can set there start point, end point, and any intervening barriers. Animation can be toggled on and off. To get a realistic estimate of the solve time animation must be off.


One of the main things I did in this recode was completely separate the astar algorithm from the GUI code. This should theoretically allow me to integrate it as is, in other programs.

The code can be downloaded as a zip.
Or you can browse the git repo online.

Any comments or advice on how to improve the algorithm would be appreciated,
New Users, Read This
  • Use code tags when posting code.
  • Include any errors with your post (in code tags).
  • Describe your problem; not your chosen solution.
  • Make examples the minimum length to demonstrate your issue.
User avatar
Posts: 1710
Joined: Thu Feb 07, 2013 11:33 pm
Location: Tucson, Arizona

Re: [pygame] A* pathfinding demo

Postby micseydel » Mon Jun 24, 2013 4:54 am

Cool! And kudos for separating interface and implementation, I don't imagine you'll regret it.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Return to Completed Scripts

Who is online

Users browsing this forum: No registered users and 4 guests