WebFund 2014W: Tutorial 6
In this tutorial you will be learning about and extending adventure-ajax-demo. This program is a modification of adventure-demo where all action occurs at the /game URL rather than individual room name URLs.
First, download and get adventure-ajax-demo running. Be sure to run storeRooms.js to get the current rooms.
Then, work on answering the following questions and doing the following tasks. Note that many of you will find these tasks to be difficult. If you show the TAs you understand the questions and have made progress on the tasks you'll get full marks for the tutorial.
Questions
- What is the raw HTML of the /game page before any client-side JavaScript runs?
- How do you get to the Void?
- How is the page updated when the player moves between rooms?
- What is the client and and server-side code for the two AJAX calls in this application?
Tasks
- Make it so that the game lists all of the players that are in the current room by saying in the last line of text (before the buttons), "Anil, Player7, Foo are here". You should omit the current player from this list.
- Add buttons above the exits that say "Actions:" followed by a set of actions.
- These actions should change the activity description of the room.
- Make a new actions property of rooms that is an array of objects, where each object has two properties: an action and a description. The action is used to label the action buttons. The description is the text that is used to replace the current activity when the button is pressed.
- The activity string should not be changed directly on the client however. Instead it should send the action to the server, the server should update the room description, and then the client should retrieve the room description again after the button has been pressed (to get the current state of the room).
- Note the room state will be the same for all of the current players of the game!
- Using this new functionality, make it possible to ring the bell in engineering (and also stop the bell ringing).