WebFund 2014W: Assignment 3: Difference between revisions
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
===Part A=== | ===Part A=== | ||
# 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? | |||
===Part B=== | |||
# 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). | |||
# Add a "quit" button to the bottom that takes you back to the initial screen. | |||
# Get the "Load" button to work by creating editor.js so that it makes the load button gets the requested room using "/getContents" and updates the form to contain the values for the loaded room. | |||
# Get the "Save" button by implementing the appropriate server-side code. | |||
# Add a room selector to the top that lists the names of all of the rooms in the rooms collection. This should be a drop-down menu or other control of equivalent functionality. | |||
# Extend the editor to work with the "Actions" from the last tutorial. |
Revision as of 00:54, 10 March 2014
This assignment is not yet finalized
In this assignment you are to examine, modify, and answer questions regarding the adventure-editor sample node application. The files of this application are also listed below. Note that to run this application you'll first need to run node storeRooms.js to setup the rooms collection in MongoDB.
Please submit your answers as a single zip file called "<username>-comp2406-assign3.zip" (where username is your MyCarletonOne username). This zip file should unpack into a directory of the same name (minus the .zip extension of course). This directory should contain:
- your modified version of adventure-editor (one version with all code changes) and
- a text file called "answers.txt" or "answers.pdf" at the top level (in text or PDF format, respectively) that contains the answers to the all of the questions, with the first four lines being "COMP 2406 Assignment 3", your name, student number, and the date. For questions requiring code changes (Part B), explain in your answers file which parts of the program were changed. You may wish to format answers.txt in Markdown to improve its appearance.
No other formats will be accepted. Submitting in another format will likely result in your assignment not being graded and you receiving no marks for this assignment. In particular do not submit an MS Word or OpenOffice file as your answers document!
Questions
There are ??? points below in two parts. Answer all questions.
Part A
- 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?
Part B
- 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).
- Add a "quit" button to the bottom that takes you back to the initial screen.
- Get the "Load" button to work by creating editor.js so that it makes the load button gets the requested room using "/getContents" and updates the form to contain the values for the loaded room.
- Get the "Save" button by implementing the appropriate server-side code.
- Add a room selector to the top that lists the names of all of the rooms in the rooms collection. This should be a drop-down menu or other control of equivalent functionality.
- Extend the editor to work with the "Actions" from the last tutorial.