OH! I get it now! What it's doing is it's going through all the elements in the array, and checking each of their coordinates against the current coordinates. It increments to move onto the next object in the array, and if none of them match, the loop breaks and it returns to the top. =)

Does that mean that I need to change the value of LOCATIONS to however many special squares I want? Like for different towns, etc.

Yes and as you do you'd, of course, have to create more location-structs to do so. Furthermore, you'll want to give each a unique string name.

After that you'll have to add additional conditions in your doSomething() method. If needed you can rename it then go to the for loop with loc in your movement-for-loop and change the name of that method to whatever you change doSomething() to.

I wasn't being at all creative, I just wanted it to make sense.


Okay, I got it integrated into my source code, and have it set up now that if the x and y coords == a town, It will tell you where you are and you'll be given a new set of options exclusive to town.

All in all, I'm pretty happy with this =)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.