[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pathfinding

Yanom Mobis wrote:

it seems to me that A* only works on tile-based games.
What if my game isn't tile-based?

I'm not sure you think that. A* (or any other pathfinding algorithm) will work for any search tree. You do need some sort of heuristic, though, that estimates how far any given position is from the goal. That's usually pretty easy though if "position" really corresponds in some way to a position in space -- just use the Euclidian distance to the goal as your heuristic.

- Joe