O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required