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
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
Over the years I have seen many techniques for sprite animation. Of the many algorithms and implementations ...