The game I'm working on now has a little square walking to a random image point on a node when you click on the area.
The character object holds a private variable with the assigned ID number of the node that it walked to last. The nodes have an array of twelve numbers that represent the image points of the node. When the character walks to a node, I set the corresponding item in the array to a 1.
My question is how can I set the item in the array of the node that the character is leaving to a zero before it leaves for the target node? Do I need to loop through all the nodes and check to see if the node id is equal to the node ID stored in the character? It seems like there should be a better way...
Download The Cap Here
P.S. further down the line, I'd like to have multiple characters that take turns moving when you click. If you have any helpful hints for that, please let me gnow.
Thanks everybody for any suggestions