
04-16-2011, 04:33 AM
|
Banned
|
Join Date: Feb 2007
Posts: 1,002
|
|
Using A* for a maze is a good way to not get through the maze. A* uses a heuristic in the name of performance, and that heuristic doesn't know much about how to solve a maze.
Look up the "wall follower" rule if you want to solve a maze.
Regardless, for any method, you will need to somehow read in the level tiles and convert that into a 2D array of paths and walls. Then on that array, you find the right path, and then convert the path back into directions to move the NPC. |
|
|