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): Returns true if (x, y) is inside the calling Ball, false otherwise.

Modify the driver file as follows:

  • Remove the Ball object global variables, replace them with an array of Ball objects.
  • In setup, initialize the array to have 10 spots.
  • keyPressed:
    • + should add a new Ball object to the array provided there is room.
    • - should remove a Ball object 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.