Basically made a javascript word game with 10 different locations using 10 different variables.
ADD ME ON SKYPE: tenkdarko
I want to make my script cleaner by adding these stuff:
Develop a Location prototype {id, name, description, item, toString()}
Instantiate an instance of Location() for each location in your game. (If you have
10 locations in your game, you'll have 10 different instances of the same
prototype.)
Store those location instances in a global array.
Modify your game so that the location functions use this global array instead of the
hard-coded text you had before.
Develop an Item prototype {id, name, description, toString()}
Instantiate an instance of Item() for each item that can be found in your game (at
least four of them) and store zero or one item at each location.
Declare a global array to hold the player's inventory. 5 points
Modify your take command to use the inventory array.
Update your i or inventory command to make use of this array when listing
the items the player is carrying.