I have a world map with a bunch of "Locations". These are all the same object, and I have added their names as instance variables as well as the name of which location the player will get to if they press left/right/up/down on the keyboard.
Example:
My hero has a "CurrentLocation" instance variable (could also have been a global variable)
I want to use the pathfinding behaviour to make my hero move to the next town, so I need to insert the X and Y of the next location for the pathfinding behaviour to run. How do I get this?
I basically want to: "set NextLocationLeftX = Hero.CurrentLocation.ConnectedLocationLeft.ImagePointX" But I can't figure out how to refer to or get specific instance variables, or how to connect them in a smart way to get this type of nested information.