You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Premasagar Rose edited this page Aug 29, 2013
·
3 revisions
Create a new JavaScript file in the /world directory - e.g. myroom.js.
Then add some basic code to create the room:
room('myroom',{description: "This is your room. It is lovely. It has nice wallpaper.",exits: {west: 'alley',east: 'temple',down: 'basement'},image: 'myroom.jpg'});
The first argument to the room() function (myroom in this example) is the unique ID for this room in the world.
The text in description option will be shown on screen when someone enters the room.
Any number of exits can be given. The user types the name of an exit to move to the next room. The ID for the next room is the value of the chosen exit, e.g. if the user types down in this example, they will move to the room with ID basement.