To move the application along, we update every ball. When a ball is updated, if it has energy it erases itself, moves a little, decreases its energy, redraws itself, then sees if it has hit anything. Since holes, balls and walls are on separate lists, different loops are required to check for each. If the ball hits another object, the object is notified that it has been hit by the given ball. Notice the use of the pseudo-variable self as the argument to the hitBy call.