There are four major participants in the animation package presented in this chapter:
Playfield — Is an An extension of the DoubleBufferedContainer class upon which sprite animation takes place.
Sprite — Is a A lightweight component that is animated on a Playfield.
Sequence — Maintains a sequence of images.
CollisionDetector — Detects collisions between two sprites and collisions between sprites and the boundaries of a Playfield.
The premise behind the animation package is simple: sprites are animated on a playfield and can may collide with other sprites and with the boundaries of their playfield. The rate at which sprites cycle through their images and the speed at which they move can both be set.
We'll begin our discussion with ...