The Participants

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 ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.