Assignment 7
Object methods and Interaction Design
Due Saturday November 2 before 11:30pm
Overview
For this assignment you will further develop and extend a simple
version of game called Archaeology.
Game files
You are provided with files that run a
rudimentary version of Archaeology. In its current form, it digs in
one hard-coded cell when the page is loaded. Additional digs require
calls from the console. Your task is to work out better approaches
for interacting with the game and displaying the outcomes of the
player's actions.
The files will be reviewed in class. To extend the game, you
should not modify the board.js file except to modify any content in
the GameBoard function (not required). Instead, you will need to
further develop the game.js file. In addition, you will need to add
counters that keep track of the player's performance.
Advice
Before you start writing code, you are encouraged to sketch out how
the game appears. Consider the following questions:
- What is the best way to enter coordinates? From the keyboard?
Menu selection? Clicking on a cell?
- What is the best way to present an outcome? An alert box will
always get a user's attention, but many find it annoying.
- How should prior results be indicated on the board? Use of
color is fine, but it should be complemented with other visual
variables.
For implementing the game, you are encouraged to do the following:
- Take an incremental approach
- Add alert or console.log statements to trace how your scripts are working
- Use the console to test out your methods
- Make use of the D2L discussion forum if you experience any technical difficulties, or even if you are not sure how to start. (Note: don't post your whole file. Posting snippets of code or explanations in English are fine.)
Requirements
For full credit, your game must meet the following requirements:
- A more interesting board presentation that uses images or alternate characters and styles to present outcomes.
- A practical method for indicating coordinates.
- A clear message that indicates when a complete ruin has been excavated.
- A display that indicates the following:
- Total number of dig attempts
- Number of successful dig attempts
- Number of excavated ruins
- When everything has been excavated, a summary
message rating the player's performance (use if statement to assess
level).
In addition to these game requirements, the html and js code should
follow good scripting practices including the following:
- Consistently indented code
- A commented section including your name and file description
- Clean separation of html, css and JavaScript
- Variables declared with let
Extra Challenges
This assignment presents many opportunities for extending the game in interesting ways. Here are some possibilities:
- Additional rules that give the
player more options, such as a device that reveals an area of the board.
- Additional hazards for digging in the wrong place.
- A delay in showing a result to add some suspense. Research
the setTimeout function for JavaScript to learn how
to do this.
- Add another game board played by the computer that competes with
the player.
Many more possibilites exist. Consider adding them to your
game!
Submission
On D2L, submit a zip file of a folder with the following contents:
- A readable document (pdf or txt) that summarizes your accomplishment and explains how you addressed the requirements.
- html file
- JS file
- Any supplementary files for your web app
When you submit, paste the URL of your web app in the submission comment.
Grading
This assignment is worth 10 points. A rubric will be provided with the submission.