CSCI 1321 (Principles of Algorithm Design II), Spring 2003:
Homework 6
- Due:
- Design due April 14, 2003, at 5pm;
code due April 16, 2003, at 5pm.
- Credit:
- Design 20 points;
code 40 points.
First review Dr. Lewis's
Project Description.
Then read the specific instructions for
Assignment 6.
In this assignment you are to do the following.
- Write code for a game status panel.
This code goes in getGameStatusPanel in your player
class. You have the option of returning up to four panels
(one for each side of the game). The parameter passed
to getGameStatusPanel indicates which panel you are
supposed to return: For example, if the parameter is
Player.NORTH_PANEL, you are supposed to return the
panel you want above the playing field, or null if
you don't want anything there.
These panels can be simple (e.g., a label that shows the
current score in the game) or as elaborate as you have the
time and inclination to make them.
- Write code that uses the Java GUI classes to interact with
either the game designer or the user.
You have several options here;
choose the one that seems most appropriate for your game.
The point is to interact with a human in some way other
than via the keyboard/mouse listeners in the player.
- Write code for an ``edit properties panel'' for at
least one of your game entity or block classes or for your
screen class.
This code goes in getEditPropertiesPanel in the
appropriate class. It is called by the screen editor when
you select one of the ``Properties'' choices from the
``Edit Left'' or ``Edit Right'' menu. You can use these
panels to edit anything about your block or entity or screen
that should be different for different instances -- the
color of a wall block, for example,
or the speed of an enemy entity. In the panel, you can
use of any of the GUI components provided by the Java
library -- text-input fields, checkboxes, drop-down lists,
etc.
- Add code to one of your game status panels to get and
process some sort of input from the user. For example, you
could have a button or text box that allows the user to change
how fast the player moves, or how smart the enemies are, or
anything appropriate for your game.
- Add an option to the ``File'' pull-down menu, such that
when the user selects it, something happens that requires
additional user input (presumably via a dialog box of some
sort).
As with previous homeworks,
you can continue to add to a previously-set-up
Together project, or you can create a new project in a new directory
and copy in the files from Homework 5.
Again as with Homework 5, be sure every class you have
designed, including the classes for this assignment,
contains Javadoc comments describing the class and its methods.
Use Together to generate HTML documentation for your classes.
For this assignment, it should go in subdirectory
Local/HTML-Documents/PAD2Project/Assn6/Design
of your Linux home directory.
Send me e-mail (at bmassing@cs.trinity.edu) telling me
that your design is ready to be graded.
Please use a subject line that mentions the course name and
the assignment number (e.g., ``cs1321 design 6'' or
``PAD2 design 6'').
For this step, finish writing the code for the class you designed
in the design step; also make any required changes to the classes
you designed and wrote for previous assignments.
I recommend that you be sure to use the
JAR file for assignment 6;
it contains code that fixes a bug with displaying game-status panels.
As before, compile and test your code.
When you are happy with how your code works,
generate a final version of your documentation,
as described above except putting the result in
Local/HTML-Documents/PAD2Project/Assn6/Final.
E-mail all your source code (.java files), and any additional
files needed for your game (e.g., files created by the screen editor)
to me at bmassing@cs.trinity.edu.
You may use either of the following methods.
- Use your favorite
mail program and attach each file as an attachment.
- From Linux/Unix, cd to the directory containing your
project and type the following command.
/users/bmassing/Pgms/cs1321/sendfiles assignment
where assignment is some text that indicates which
assignment this is (e.g., ``hw6'' or ``homework 6'').
This script will e-mail all files in the current directory
except the ones that I don't need or will recreate.
It also sends a copy of the e-mail to your Trinity account,
so you can be sure about what was sent.
Berna Massingill
2003-04-10