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

(updated 11/9/2006)


This is the fourth and final installment of your first project, MazeWar.  Hopefully you've been keeping up with the project and enjoying yourelf.

In this project, you will be implementing a rational reconstruction of the historic MazeWar game.  It was generally described in the specifications for your first project deliverableFinally, this fourth deliverable will be a group effort.  You will work together and submit a single final product.

Deliverable 4:  Finishing everything

This week, you'll finish the MazeWar rational reconstruction.  This primarily involves handling multiple rats in the maze, shooting, and scoring.

Handling multiple rats.  The server (MazeWar) should start listening for requests to join the game on the MazeWar port.  When a request arrives, if the game is not already full, the requesting rat should be added to the game and placed in a random open spot in a random orientation.  When a rat leaves the game, it is removed from the server; if the game had previously been full, the server will once again accept requests to join the game.  The rats currently in the game may independently move freely through the maze.  The server does not wait for a rat to move, but should cycle through all the rats checking to see if movement or shooting requests are present.

An important feature of handling multiple rats is displaying another rat in the maze.  Create a way to render another player.  If you can replicate the eyeball from the classic MazeWar, so much the better.  Whatever rendition you use, it should be scaled according to its distance from the point of view.

Shooting.  A rat may shoot a projectile in the direction it is facing.  The projectile should travel approximately one maze cell per 100 milliseconds.  If a rat occupies the maze cell that is traversed by a projectile at the same time, the rat is tagged.  It is not expected that a rat could move faster than its projectile and thus shoot itself, but you need not prevent that from happening.  A tagged rat is reborn in a random open cell of the maze (i.e., without a wall or another rat) with a random orientation.  There is no limit to the total number of projectiles a rat can fire, but a single rat may only fire one projectile per second.  A projectile is consumed when it hits a rat or a wall. 

Scoring.  Across the bottom of your display, list the current participants in the game, together with their scores.  Players get 10 points for tagging a rat, lose 10 points for getting tagged, and lose one (1) point for every shot fired.  Whenever any player's score changes, a player joins or leaves the game, all the players should receive updated score lists.

Working as a group
This final MazeWar deliverable will be a group effort.  You will encounter challengings specific to a group project.  These will include but not be limited to: coordination, planning, partitioning, motivation, accountability, and timing.  But it should be a great experience.  It is rather unlikely that you will ever work on a solo project after you graduate.  Now is the time to start learning about working in groups.

You will be collectively responsible for balancing the work load.  I will expect an accounting of who contributed to what parts of the code.

Before you begin, it is still really important that you spend time thinking about your design.  For example, what types of information and in what form needs to be sent between the server and client.  You'll need to come up with a protocol that provides a consistent scheme sending this information back and forth.  Again, you should not be afraid to scrap your working code entirely if it will improve the elegance or efficiency of your final deliverable.  Also, you should be applying the techniques we learned in CS010 and those we talked about at the beginning of the semester to your design and your coding. 

Objectives
1.  Gain experience using threads
2.  Finish the multi-player game
3.  Have lots of fun
4.  Learn about working in a group

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