Mze navigation
Hey ppl,
whats the best way to navigate through a maze? Pixel perfect (I know how to do that) or tile perfect (I dont know how, but have been recommended that I do so).
Maybe if someone here could explain to me how to do tile perfect navigation of a maze, like a pacman maze, then I could say.
-"Thanks in Advance"
[341 byte] By [
javatypoa] at [2007-9-28 8:18:48]

you could define an matrix, where every element it's a tile.the dimesions of the tiles are fixed, 16x16 pixels if you want.to navigate through the maze you could divide each (x,y) of the player to 16 to get the index in the matrix.catalin
Okay thanks, I think I understand you.So when dividing by x,y by 16, is it each x,y that the pacman contains?Or just at the top left corner. Maybe a small code sample just to clarify.
You'll need to know if your player is completely inside of a tile or crosses one or more tiles. So perhpas two checks x,y and then x+w,y+h, this then x/tileWidth through x+w/tileWidth gives you all of the columns the player is on. y/tileHeight through y+h/tileHeight gives you all of the rows the player is on. then you check which direction the player can move based on those two sets. Hope that helps. This is just a quick idea so there are probably better ways to handle it.