[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: 1704
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.
Join the #python-forum IRC channel on irc.freenode.net for off-topic chat!

Please prefer not to PM members. The point of the forum is so that anyone can benefit. We don't want to help you over PMs/emails/Skype chats that others can't benefit from :)
User avatar
Posts: 2904
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 2 guests