|
Write a program that displays falling balls, having random radius of between 5 and 40 pixels. At any stage, there should be exactly 3 balls that are on the screen; one each colored blue, red and green respectively. The window background should be white and size should be 600 pixels wide and 600 pixels high. The balls originate from the top of the window (from a random x co-ordinate) and fall down with random speeds (1 to 3 pixels drop per refreshment of draw()). Each ball falls with the same speed throughout it’s fall. Once a ball drops off the window, another ball of the same color, starts from the top of the window.
求解 |
|