The most recent versions of the project files are here, with changes noted. To get a previous version, just change the file name in the address bar of
your browser. (Note: MS Word files are much larger than the pdf files. Also, to make things smaller I have split off the GUI sample files and the sample
scenario files into separate downloads.)
Project Description: pdf | doc
- July 30 (v2): Added (tiny) note about new "GrabFlagAndGoAction" move.
Source Files: zip
- July 30 (v2): Added GrabFlagAndGoAction class.
- July 30 (v2): Changed old loadIcon() so it looks in more reasonable directories.
- July 30 (v2): Grouped sample scenario files into single zip file (see newsgroup for details).
- July 30 (v2): Added a new loadIcon method that takes a file name and zip archive.
- July 30 (v2): Example zip file usage added to main(). Check out loadIcon as well.
- August 2 (v3): Fixed typo in GrabFlagAndGoAction.java
- August 2 (v3): Fixed bug in Player.hasFlag(). (should be 'key != gameKey')
- August 2 (v3): Changed Place constructor to take an ImageIcon instead of String.
Scenario Files:
Roadmap: pdf | ppt
GUI Sample: zip (A series of images showing what the graphics might look like as it is being
drawn.)
GUI Solutions: Gui.zip [ Updated: 9:42PM Wed. ]
Note: Added a "GoHome" checkbox to the GUI.
At this point, you should all be finished with your GUIs. If not, you would probably do best to move on to other things, especially the
shortest-path and graph-search parts.
To help you do this, I am providing a solution for the GUI. Here you will find a set of class files. Put these class files along with your other
files. Be sure to save your java files (preferrably in some other folder, so they don't get compiled any more).
In order to handle the end-of-game, the GameWindow class provided here has a method
public void setWinner(Team team)
which you can call from Game when the winner is determined. This method will stop the game (setRunning(false)), disable all the buttons, and put up
a message.
Game Solutions: Game-v2.zip
[ Note: Bug in "step" mode fixed August 6, 12:26AM ]
Here are files that implement the game functionality (Phase B, that is). You may use these if you want to skip ahead
to the last part, Phase C. Included is the Game class, with all of the rules enforced (correctly, I hope!). Also included is a shortest-path-tree
class, used to enforce the go-home behavior. You obviously won't get to use this for your players.
The Game class makes one assumption about the GUI for the end of the game. It calls a method
public void setWinner(Team team)
on the GameWindow when the game is over. This should put a message on the screen or something. The above GUI solutions do this, so the two pieces
fit together.
Teams: KWGnats.zip,
KWTheOptimist.zip,
Some teams to play with. Unzip into your project folder, and add "KWGnats"
and "KWTheOptimist" to your list of available teams.