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

(updated 11/8/2006)


This is the second 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.  It was generally described in the specifications for your first project deliverable.

Deliverable 1.2  The rat in a maze

Elaborate the application you began last week.  Write a Rat class that will allow an instance to ambulate through the maze you read from a file last week.  The rat should move in response to keyboard command input from the user and should display the first person perspective of the rat's location in the maze.  The user should be able to toggle between the first-person view and the overhead view from last week.

Movement.  Select a rational key-command layout for move-forward, turn-left and right, move-back, and fire.  (Possible bonus points if you can locate the original command key-bindings and provide a link.) Advanced key commands allow the rat to peek left and right around a corner.  These peek commands actually move the rat (forward and turn-right or left) but only while pressed and then reverse the move (turn-left or right and back) when the key is released.  Note for future installments, the rat is visible and can be shot while peeking from either hallway (the initial spot and the peeked-into hall).

First-person perspective.  A rectilinear architecture has a vanishing point toward which all parallel lines converge.  Rendering a scene on your screen amounts to computing the projection of points in the 3d environment that we want to model onto a viewing screen.  Our eye (point of view) is on the near side of the viewing screen and the modeled environment on the far side. As an enhancement to the classic Maze War game, I want you to allow an input height argument for the rat's point of view.  That is, if the rat is tall, the perspective will reflect a view closer to the ceiling.  Similarly, if the rat is small, the perspective will be closer to the floor.

Toggle view.  Pick a key that will toggle the displayed image between the first-person view and the overhead view you did last week.  In the overhead view, you should display the location of the rat within the maze, together with the rat's orientation.

Before you begin, it is still important that you spend time thinking about your design.  Just because you (hopefully) have a working deliverable 1.1, you should not be afraid to scrap your design entirely if it will improve the elegance or efficiency of your final deliverable.  Again, 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.

Objectives
1.  Gain experience with basic concepts in computer graphics
2.  Continue exercising design skills as you implement the rat in a maze
3.  Have fun

Submission Instructions:
On your machine where you are doing your homework, create a folder called <your email name> followed by "P1.2".  For example, someone with email address "cjones" would create a folder called "cjonesP1.2".  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.2" will be created.  Finally, submit via Eureka.