View Single Post
  #3  
Old 04-16-2011, 04:33 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
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.
Reply With Quote