Posted: Thu Nov 12
Due: Friday 11/13 10:00am
Submission name: w23_array
First, get the starter code
Start with a working version of the colliding ball program (w22_collision), which you can get from thesource if you need it. The Ball class there has an extra method:
isSelected(int x, int y): Returnstrueif(x, y)is inside the callingBall,falseotherwise.
Modify the driver file as follows:
- Remove the
Ballobject global variables, replace them with an array ofBallobjects. - In
setup, initialize the array to have 10 spots. keyPressed:+should add a newBallobject to the array provided there is room.-should remove aBallobject if there are any to remove.
- Modify the rest of the code to use the array. You may wish the write standalone functions for some of these operations.