Due: Friday, Oct 1st by 11:59 PM
Your task is to complete your implementation of the Disk Placement game described in the previous assignment. You should implement all of the features described.
You will use the Disk class you implemented in the previous assignment as an important building block in the completed game.
Start by making a copy of your CS201_Assign2 project (which you completed in the previous assignment.)
To make a copy of a project in Eclipse:
When you choose Paste, you will see a dialog box similar to the following one:
Change the project name to CS201_Assign3:
You will make all of your code changes to the DisksPanel class, which implements the game play.
You should add whatever fields are necessary to represent the state of the game. You will probably want to use an array of Disk elements to represent the disks that have been placed.
The handleMouseMove method is called whenever the mouse pointer is moved within the window. You can get the x and y coordinates as follows:
int x = e.getX(); int y = e.getY();
where e is the parameter to the method, an instance of the MouseEvent class. You will need state variables to keep track of the current location of the mouse pointer.
The handleMouseClick method is called whenever a mouse button is clicked. You should use this method to place a disk in the window. You will need to check to ensure that the placed disk
The WIDTH and HEIGHT constants provide the width and height of the panel.
Remember that you will need to call repaint to force the contents of the panel to be redrawn when the game state changes.
When the next disk is ready to be placed, its radius should be randomly chosen in the range 10..44, inclusive. You can generate random numbers using an instance of the java.util.Random class as a field:
private Random rand;
Create an instance in your constructor:
rand = new Random();
You can generate a random number uniformly chosen from the range 0..n-1, inclusive, using the method call
The paint method should use the fields representing the game state to render the current configuration.
Some java.awt.Graphics methods that will be useful:
To run the program, right-click on DisksApp.java and choose Run as->Java Application.
The grading will be done as follows:
Export your finished program to a zip file (right-click on the project, then Export...->Archive File). Upload the zip file to the marmoset server as project assign3. The server URL is
IMPORTANT: after uploading, you should download a copy of your submission and double-check it to make sure that it contains the correct files. You are responsible for making sure your submission is correct. You may receive a grade of 0 for an incorrectly submitted assignment.