In episode 15 we created a program that displayed one circle bouncing on the four borders of the screen. We now take that program and modify it so it can show any number of bouncing circles.
The original program used four global variables. Two for storing the horizontal and vertical position of the circle, and two for storing the direction in which the circle is moving.
Those four variables must now be arrays. The arrays will hold the horizontal position of each circle, the vertical position, the horizontal motion amount, and the verticla motion amount.
Because there are several circles now, we have to use a while loop to go through each circle in the array to draw it and move it to a new position.
We could have created several circles when the program starts, but instead we begin with no circles, and let the user click the screen to add new ones.