Copyright by Jonathan S. Harbour

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 7. Sprite Animation

This chapter adds a significant new feature to your Java toolbox—the ability to load and draw animated sprites and apply that knowledge to an enhanced new sprite class. You will learn about the different ways to store a sprite animation and how to access a single frame in an animation strip, and you will see a new class called AnimatedSprite with some serious new functionality that greatly extends the base Sprite class.

Here are the key topics we’ll cover in this chapter:

  • Sprite animation techniques

  • Drawing individual sprite frames

  • Keeping track of animation frames

  • Encapsulating sprite animation in a class

Sprite Animation

Over the years I have seen many techniques for sprite animation. Of the many algorithms and implementations ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required