Jump to and display the next object in an Array
<p>I have been avoiding posting something on here because I was determined to work it out myself, but I have hit a wall. </p>

<p>I have only really been working with jQuery / Javascript for a short amount of time, and in small capacities (basic animation and so on) and I set myself a challenge (and help myself learn) to convert my rather boring portfolio website into a basic "point and click" or text(ish) based game to display my illustrations in a more interactive / creative way. </p>

<p>Anyway - to the point. </p>

<p>I have constructed an array of objects with information about the different areas, and what i was hoping to do is associate either a direction (north, south) with each area based on the the area information. </p>

<p>The Array:</p>

<pre><code>var areas = { 

"outskirts" : {
"name" : "Dead city Outskirts",
"info" : "What you see around you",
"image" : "images/outskirts.jpg",

},
"path" : {
"name" : "A lonely Path",
"info" : "What you see around you",
"image" : "images/path.jpg"
},
"cliff" : {
"name" : "An Ultimatum",
"info" : "What you see around you",
"image": "images/cliff.jpg"

},
"city" : {
"name" : "Carcass of a City",
"info" : "What you see around you",
"image" : "images/city.jpg"
},
"building" : {
"name" : "Once a home",
"info" : "What you see around you",
"image" : "images/city.jpg"

}
};
</code></pre>

<p>so for instance,</p>

<p>you start in the outskirts and get information saying that you can move north
and you either type or click an item that says "north" and then it switches to the next area which is "path".</p>

<p>and then populate all of the information based around Path, (name and info and so on) </p>

<p>I thought if I added "exits" to the objects such as:</p>

<p>"exits" : {
   "north" : "path",
   "south" : "cliff"
   },</p>

<p>this could be the key I guess to what directions you could travel, or possibly a true or false statement based on the directions for each area.</p>

<p>So really what I am asking is :</p>

<p>How to do I Move between each area? (change from outskirts.name to path.name)
Am I going down the right road? (My problems could come from inexperience)</p>

<p>I thank anyone that can suggest a solution in advance, and any advice is greatly appreciated.</p>

<p>Thank you for your time.</p>
