Now that we've covered the Sequence, Sprite, and Playfield classes, the only topic left to discuss is collision detection. Collision detection is defined by an interface and an abstract class: CollisionArena and CollisionDetector, respectively. As we discuss collision detection, don't forget that Playfield implements CollisionArena, so everything discussed concerning CollisionArena goes for Playfield.
The CollisionArena interface defines the behavior of an arena in which collisions take place, as you can see in Example 25-4.
import java.awt.Dimension; import java.awt.Insets; ...