CSCI 1321 (Principles of Algorithm Design II), Fall 2003:
Homework 1

Credit:
Design 40 points; code 20 points.


Contents

Overview

This assignment is less about you writing code and more about thinking about what you are going to do for the project and getting used to Java and Together. As with all of the assignments, there are two distinct due dates. On the first one you will turn in your design documents; on the second one you will submit the code itself. In this assignment, the code is very short and simple; you will likely write far more comments (describing your design) than code.

Before reading further, be sure you have read the Project Description giving the overall description of the project and general requirements.

Design

Ideally you will write your design in the form of comments for the class that will contain your main program; they will then appear in the HTML documentation generated by Together. (If you can't make this work by the due date, just send an e-mail with a text description.) This documentation will not necessarily set in stone every detail of the game you will write, but you should be as specific as you can. In particular, you should first give a general description of the game and roughly how the user will play it, and then explain how you will implement this using Dr. Lewis's framework (i.e., what kinds of Block, and GameEntity classes do you think you will need?) For example, in a very simple Pacman-style game you might need two kinds of blocks, one for walls (obstacles) and one for the rest of the playing field, and two kinds of game entities, one for enemies and one for things you pick up to score points.

Code

For this assignment, all you have to write is a class with a main method that does the following:

When you compile this program and run it, it should bring up a window for a very simple ``starter'' game.

Details

What files do I need?

You will need the JAR file for this assignment, PAD2Assn1.jar. You will probably find the project API and the Java 1.4 API (linked from the course ``Useful links'' page) useful.

Creating a project using Together

See the course ``Useful links'' page for information on running Together on one of the lab machines or on your own machine. Once you have started Together, do the following to create a new project and set it up for this assignment.

Completing the design step

Once you have your project set up as described above, do the following steps to finish the design part of this assignment.

Turn in your design as described in the ``Project Description'' document.

Completing the code step

For this step, you are to add a main() method to your main game class. The parameters, return type, etc. of this method should be the same as in the examples we have done in class; what the code should do is described earlier. You will be making use of Dr. Lewis's GameSetup and MainFrame classes; to find out how to use these classes, read the project API documentation.

Once you have written your code, compile it and test it. Here are some tips on writing, compiling, and testing your code using Together. They assume that you have followed the preceding steps for creating a project and documentation for your main class.

When you are happy with how your code works, generate a final version of your documentation and turn in the code as described in the ``Project Description'' document. For this assignment, you will be turning in a single file, the one containing the source code for your main class. (For example, if your main class is called MyGame, this file will be MyGame.java.)

Hints and tips

Notice that you can do everything except generate HTML documentation using command-line tools, if you need to work on your project on a computer that doesn't have Together installed or doesn't have enough memory to run it with acceptable performance (or if you just decide you prefer editing code with vim!). See Java Without an IDE for details. If you do this, the next time you open the project with Together, it should pick up any changes you made with other tools; you can use the Synchronize with External Changes option from the File menu if it doesn't seem to be doing so.



Berna Massingill
2003-11-04