<img src="http://i.imgur.com/3VVk1VC.png" border="0">
Added two new fields for the highlight function. Each highlighted square now shows how far away it is from the current active object, as well as which direction:
1 = left, 2 = right, 3 = up, 4 = down
<img src="http://i.imgur.com/Ifco3i7.png" border="0">
In the above picture, the computer AI selects an object based on highest range, determines the closest player object to it, and sets it as the target. Then it highlights all available moves the program can move:
<img src="http://i.imgur.com/bEW1WLa.png" border="0">
However, what it needs to do next is construct a direction list so it knows how to move from its current square to the square closest to the target.
<img src="http://i.imgur.com/SIRGp3P.png" border="0">
I call the PathToDestination function earlier (scroll up).
However, my "dirs" variable always equals "" and I'm not sure why. Can someone take a look?
vee41 maybe? I know, I ask you too much :(
R0J0hound, my events are based on your example, except instead of creating the squares on the board and then moving, I highlight the squares, then assign distance and direction variables only to the highlighted squares.