CS 110 Introduction to Computing

Project #9: Daleks move ... Dr. Who dies!


In this portion of the Dr. Who game you will be making Daleks move. The basic sequence of operations of the game Daleks will be complete at this point. The sequence is:
  1. Dr. Who moves (note that Dr. Who can choose to move, but remain in place.)
  2. If Dr. Who bumps into a Dalek, he dies.
  3. If Dr. Who is within 1 space of a Dalek, he dies.
  4. If Dr. Who is alive, then the Daleks move.
Rather than having you write the code the make the Daleks move, go to http://mainline.brynmawr.edu/cs110/daleksmove.java. This file contains a single function moveDaleks, which takes one argument, the Daleks board (as a 2-D array of integers). The programming part of this assignment is to copy this function into your Daleks program and call it at the appropriate time (in the appropriate way).

Once you have integrated this code into yours, write up a complete description of the rules controlling the movement of the Daleks and describe how those rules are implemented in the code I provided (ie., describe how the code actually works). This description should be less than a page long.

As before, Dr. Who must remain on the board. He cannot step on rocks or Daleks and make them disappear. However, to make the game more interesting, lower the number of rocks initially on the board to only 2% of the spaces. Also lower the number of Daleks to about 2% of the spaces. So doing gives Dr. Who a chance to survive and gives you a better chance to explore the rules controlling the movement of Daleks.


Due Date: December 2, at the beginning of class.
Submit:
Grading: Applet 10 pts
Dalek movement analysis 90 points

The Future

The final assignment gives Dr. Who two new abilities: the "sonic screwdriver" and "hyperspatial jump". Both can be done only once per game. At any given time Dr. Who can unleash the "sonic screwdriver" which causes everything within 3 spaces of Dr. Who to disappear. "Hyperspatial jump" allows Dr. Who to jump from where he is on the board to somewhere else. Unfortunately the technology is random -- Dr. Who never knows where he will end up. Hence, he could jump and be right next to a Dalek, and therefor die. In addition, in the final assignment you will add a "restart" mechanism to your game. All of these new capabilities should be linked to keys on the keyboard.