pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
A* algorithm

A* algorithm

Cepheus (cepheus)

Tags:

Description

...

Links

Home Page: http://pygame.org/

Screenshot


click to view original size

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

June 20, 2010 6:47am - Mayec Rancel - nickname: (mayec)
I noticed that it lacks the option to avoid diagonal movement when moving around corners. It's easy to add, by adding some if statements inside inspect_adjacent(), to skip inspecting certain diagonals if an adjacent non-diagonal node is impassable.
December 10, 2009 3:52am - Cepheus - nickname: (cepheus)
Hi Fredrik, I'm glad you liked it. I took a look at your optimization and they're great. Your optimization of the code is about as easy to understand as the original code with the added benefit of a major speedup, so I've merged the changes - thanks for your contribution :)
November 7, 2009 2:45pm - Fredrik Corneliusson - nickname: (tomten) - 4/5
Great!
I needed this for a game I'm tinkering with and this was one of the cleanest A-Star implementations I found.

However to try and make it a bit more realistic performence wise for my maps I optimize it a bit (but I do not think it hurt readability too much).

With my test map I managed to get a X10 speedup (and a less memory usage by using __slots__ for the node object).

I added my version here:
http://turb-game.googlecode.com/files/astar-1.0.1_fc.zip

Feel free to merger the changes if you feel it's appropriate.

Warning: I cannot guarantee I've not broken the algorithm but at least I managed to reproduce the screen shoot.
October 5, 2009 7:37am - Cepheus - nickname: (cepheus)
Aye, it should. I think I'll fix it in the next update.
October 1, 2009 11:45am - Carsten Eggers - nickname: (masterlee)
When pressing enter old values should be removed
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Dec 16, 2014


Dec 14, 2014

Dec 9, 2014

Dec 6, 2014

Dec 5, 2014

Dec 3, 2014

Nov 27, 2014


Nov 13, 2014

Nov 11, 2014


... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)