[an error occurred while processing this directive] Untitled Document

Assignment 05

  1. Due Date
  2. Download Files
  3. Description
  4. Submission
  5. Test Compile
  6. Interview Marking

Due date

This assignment is due Monday, December 4th at 4:00pm.

Important Note: Late assignments will not be accepted!


Download

Download the file A05.zip and extract the files to the cs133 folder on your Home directory. You will use these files to complete this assignment. These files contain methods which we expect to be implemented without changes being made to the method signatures. You are allowed to add helper methods.


Description

Base Assignment

For this assignment, we will return to the Daleks game from Assignment 2 and extend it in two ways.

For the first extension, the game will now continue over a series of levels 1 through 12. At each level, the number of Daleks chasing the Doctor will be 1 + (2 * level). Once again, the game is over if the Doctor is captured. If all of the Daleks on a given level have crashed, the next level starts with the correct number of Daleks. As before, all participants start at random locations, but for this assignment each participant must start at a different location (unlike before, where there could be crashes or captures from the initial positions). After level 12 is reached, the game continues until the Doctor is captured but the number of Daleks does not increase. To make enough space for all of the participants, make the playing board 20 by 20.

For the second extension, you will implement the Board class to play the game, replacing our version. You only need to implement the public Board methods defined in the Board.java class contained in A05.zip, for a 2D board. Because you do not have the capability of implementing the getClick() method, interaction between your Board class and your Daleks game will have to be done through the use of a listener object. This will be done in a manner that is almost identical to the use of the MouseListener discussed in class (which you will also need to use in order to capture mouse clicks on your Board).

Note that your implementation of the Board class must provide a general game board that can be used to implement a variety of games and programs, like the original Board. It must not contain any code that is specific to the Daleks game. When your Board class is complete, you should be able to run your version of Assignment 4 with your Board to display pictures without making any changes to your Assignment 4 code. With some work (to change the way mouse events are handled using the listener), you should also be able to run the Eight Men in a Raft puzzle from Assignment 3 on your new Board. If you include Dalek-specific code in your Board class, you will lose marks.

Included in the classes for the assignment is the interface BoardListener, which defines the method squareClicked(Coordinate coord). This method should be called on a registered listener object by your Board class whenever a square is clicked, with the location of the click provided in the supplied Coordinate parameter. The CatchGame class should implement this interface and be registered as the listener object. Your new Board class should include a method to register a BoardListener object (just one in this case, to keep it simple). On a mouse click (handled with a MouseListener somewhere in your Board implementation), a new Coordinate object containing the board position of the click (not the pixel coordinates provided by mouse events) should be created and the squareClicked(Coordinate coord) method should be called on the registered listener. If no listener has been registered, the mouse click should be ignored. Your Daleks game will need to be changed to use this new method of obtaining mouse clicks. You should use the version of the Coordinate class that was provided with the original Board class.

Correctly implementing the extended Daleks game with your own Board class (including proper documentation and style (as described in the CS 133 Programming Style Guide), and the use of stepwise refinement) will get you 100% for this assignment. However, you have the opportunity to get a mark of more than 100% by including one or more extensions listed in the next section.

Steps to Completing Assignment 5

We suggest that you tackle Assignment 5 by following the steps below:

  1. Fix your Daleks game from Assignment 2 for the original Board class, based on feedback from the markers, comments on common errors for the assignment, information from the presentation in Lab 06, and any help you received in Lab 09. When fixing your assignment, try to consider how to implement the game by determining which objects should be responsible for each part of the overall functionality (which means there should be code in all of the classes and methods originally provided with Assignment 02). You may even consider reimplementing Assignment 02, taking into account all that you've learned since Assignment 02.
  2. Augment your Daleks game to implement the more general version of the game described above, again working on the original Board class.
  3. Once you have the game working correctly, reimplement the Board class based on the information from Lectures 19 and 20.
  4. After your Board is complete, change your Daleks game to handle mouse events in the new manner described above.
  5. Enjoy playing the Daleks game on your new Board class.

Following these steps should make the assignment easier to manage. Further, if you experience problems when implementing the Board class, you can be reasonably certain that the problems exist in your Board and not in your game. Finally, following these steps will discourage you from including Dalek-specific code in your Board class.

Assignment Extensions

It is possible to substantially increase your mark (beyond 100%) by implementing one or more of the following enhancements. These enhancements include improvements to both the Daleks game and your Board class. Be sure to get the required part of the assignment (as described above) working completely and correctly before starting any enhancements. If the required part doesn't work, it will not be possible for us to evaluate your enhancements and your time will be wasted.

A good idea is to save a copy of your assignment before you start the extensions and after you complete each extension. That way, you will always have a working version you can submit when the due date arrives.

Note that you don't have to implement the extensions in the order in which they are shown here. However, some extensions build upon one another or are related.

Be sure to document your extensions as described in the CS 133 Programming Style Guide.


Submission

Electronic Submission

This assignment will be submitted electronically. Go here for information on how to submit files electronically.

For this assignment, you may write additional classes not listed here if you wish. Create and submit a zip file called A05submission.zip that contains everything needed to run your program. Read these instructions if you don't know how to make a zip file. Submit your file using the handin code 05.

Files to Submit

Note that the following class will be replaced with our own copy before your assignment is run:

You may submit the assignment file as many times as you like prior to the submission deadline; a later submission replaces any previous submission. Submitting early ensures that you are able to submit, and that you will receive some credit if you inadvertently fail to submit your final version of the assignment by the submission deadline.

Late submissions will not be accepted, and no submissions will be accepted via e-mail. It is your responsibility to ensure, prior to the submission deadline, that the submission process works for you, and it is your responsibility to make your final submission sufficiently in advance of the submission deadline as to ensure that there is an adequate margin to allow for unexpected delays.

We will be compiling and running your submission. Be sure the your submission compiles.

After you have gone through the steps for electronic submission (by running an X11 window and executing the submit command), if you want to check to see what files have successfully been electronically submitted, click the button below and enter your Quest password.


Compilation Request

Press the button to request that the files for the assignment be compiled and run. This facility is here to allow you to ensure that you have:

  1. submitted all required pieces of code
  2. no compilation errors
  3. no package names

You may not request testing for a particular assignment once its late deadline has passed. The results will be emailed to the specified userid upon the next scheduled test run (every 10 minutes).


Interview Marking

Part of your overall assignment mark will come from a brief interview with the TAs and Tutors. During this interview you will be demonstrating your program with the enhancements you have made. Marking will take place on December 6 and 7. Each interview will take approximately 15 minutes to complete. Click on the button below to login and schedule your marking time. If you are having troubles booking a time or logging in, please email or see a tutor.

[an error occurred while processing this directive]