Assignment 2
User Interface to a Simple Game
Due Friday May 1 before 11:30pm

Overview

For this assignment you will further develop and extend a simple version of game called Archaeology. Like the first programming assignment, this project requires an individual effort (see course policies on collaboration for details).

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 do not need to modify the board.js file to meet the basic requirements of the assignment. However, 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 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).
  • Appropriate visual effects from the jQuery library. Make sure you present what you added in the summary statement noted below.

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 var

Write a summary statement (one or two paragraphs, possibly with bullet points) that presents the added features you implemented. Include your summary statement as HTML content accessible from your game interface.

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

Submit your files in a zipped folder to D2L. If you can post your files online, submit the URL in the comment.

Grading

This assignment is worth 20 points. Apps that address all of the requirements with a well presented summary statement will receive 20 points.