We will use the GENERIC_GRID and GENERIC_CELL classes from the last lesson:
GENERIC_GRID class source code
GENERIC_CELL class source code
We will extend these generic classes like so:
CD_GRID class source code
CD_CELL class source code
Here are the rest of the pages associated with this game:
Game Directions
Game Page
Applet class source code
Discussion:
There are two methods which you should pay special attention to in CD_GRID. First of all make sure that you can follow the logic in the collision_check method. A lot of how this method works depends on keeping track of the indexes of the map array and the targets array.
Also make sure that you understand how drawTargets works. Notice that there is a boolean value added to the call to draw in CD_CELL.
ASSIGNMENT:
Add a timer to the game so that the player's final score is based on how long it takes to clear the board. Add a penalty of five seconds for each miss to this score.