evil monkey wrote: > I used this AStar in some of my games, and it works very well: > http://www.pygame.org/projects/9/195/ I wrote an A* implementation awhile back for civil that might make another good example. Mine is a little different from the others I've seen as it can handle a few different map shapes including hex based maps. I've since packaged it separately and you can find it here: http://zhar.net/projects/gameai/ There are a few other python implementations of A* that I know of as well. They are also linked to from that page. A great site to read about path finding in general is Amit Patel's perennial site on the matter: http://www-cs-students.stanford.edu/~amitp/gameprog.html > On Sun, 25 Jan 2009 19:16:38 -0800 (PST) > Yanom Mobis <yanom@xxxxxxxxxxxxxx> wrote: > > > 1) How is pathfinding done? > > 2) How do you prevent a moving sprite from being caught in a v-shaped rut made of obstacles? Like this: > > __ > > A -> # | B > > __| > > > > > > Where A and B are the points the sprite needs to travel, > > # is the sprite, > > -> is the direction the sprite is moving, and > > _ and | are obstacles? > > > > > > > > -- John Eikenberry [jae@xxxxxxxx - http://zhar.net] [PGP public key @ http://zhar.net/jae_at_zhar_net.gpg] ______________________________________________________________ "Perfection is attained, not when no more can be added, but when no more can be removed." -- Antoine de Saint-Exupery
Attachment:
signature.asc
Description: Digital signature