Move Character in 2D Maze, use Mouse instead of Keyboard
Hi! Let say I have a 2D array tile map. If I want to use mouse click to point where my character will go intead of using Key event. Do I really need to implement some AI, like search for shortest path and avoid objects and walls, between the current position and the destination (Where I click).
Can someone tell me an idea how to do, is there other easier way? Thanks!
[383 byte] By [
Katzuraa] at [2007-9-28 8:26:20]

> Hi! Let say I have a 2D array tile map. If I want to
> use mouse click to point where my character will go
> intead of using Key event. Do I really need to
> implement some AI, like search for shortest path and
> avoid objects and walls, between the current position
> and the destination (Where I click).
Well no you don't, but that would make your character go through the walls then.
> Can someone tell me an idea how to do, is there other
> easier way? Thanks!
Search for depth-first algorithm or breadth(sp?)-first algorithm.
They are fairly easy to implement.