CS30 -- Introduction to Computer Science II
Fall, 2006
Project 1: MazeWar
Deliverable 1

(updated 11/8/2006)

This is the first installment of your first project.  You will enjoy these project deliverables if you stay on top of the work.  Do not wait until the last minute to work on the project deliverables.  You will suffer in many ways if you do.

Our first project will be a rational reconstruction of the historic MazeWar game.  Maze War was perhaps the very first multi-player first-person shooter game and was created in the early 70s at NASA Ames Research Center.  You can read more about it here.  We (you) will implement a rational reconstruction of the game in Java.  The project will consist of four deliverables.  The first deliverable (this assignment) is intended to be relatively gentle.  The following three deliverables will be more substantial.  The second deliverable will add a rat to the maze, a first-person perspective view of the maze based on the location and orientation of the "rat".  The rat will be able to move through the maze passages (but not walls) and the player can toggle between overhead and first-person views.  The third deliverable will entail partitioning your code into a client-server model supporting a multi-player networked game.  One server will manage the game state and the movements of the client players.  The clients will render the view of the maze (and other players) and will send movement commands to the server.  The final deliverable will add shooting and scoring and perhaps a few surprises.

Deliverable 1.1  Initialize maze and display birds-eye view

Write a MazeWar class that will read a text file and display the birds-eye view of the maze represented in the text file.  The MazeWar main method should accept a command-line argument that is the name of the file from which to read the maze.  The text file will contain a specification of a maze using a grid of 1's and 0's, where a 1 specifies a wall and a 0 specifies a space.  Note: the input file does not have spaces between the 1's and 0's.  Spaces and walls both occupy a single square unit of space.  Thus, walls are as thick as passageways are wide.  The input file will consist of n lines, each one having m characters (1's and 0's).  The perimeter of the grid of numbers will all be 1's (and therefore, the maze will be completely enclosed).  The maze file should be commandline argument to your program.  That is, you should be able to run your program with different mazes without recompiling.

Your class should also display the overhead view of the maze in a window.  The window should be sized according to the size of the maze specified in the file.  Again, display the maze such that the walls have the same thickness as the passageways.  See the pictures at the link above for some examples.

Before you begin, it is important that you spend time thinking about your design.  Apply the techniques we learned in CS010 and those we talked about at the beginning of the semester.  Read about the Maze War game in order to get an idea of where we are headed.  Think about the features and capabilities that you will have to implement for the next two deliverables.  Decide on what objects exist in the world you are modeling and then design your classes accordingly.  Think about the services that these objects need to provide and define your public interface with those in mind.  The short description above, together with the information at the link provided, should allow you to anticipate requirements and start with an appropriate design.  But if you do not come up with an adequate design, you can always adjust later -- it is just much more work.

Submission Instructions:
On your machine where you are doing your homework, create a folder called <your email name> followed by "P1.1".  For example, someone with email address "cjones" would create a folder called "cjonesP1.1".  Inside that folder, place whatever Java files are necessary for your Programming Projects in the same folder.  Finally, either tar or zip the folder so that when extracted, the folder "<emailname>P1.1" will be created.  Finally, submit via Eureka.