7. Animation
We’re starting to add all the core classes to our game engine. We can now render an image using the Image class and apply different functions to it, such as scale, rotation, and color. In Chapter 6, “Sprite Sheets,” we looked at the SpriteSheet class that enables us to store multiple images that share the same dimensions in a single image and then retrieve a sub-image (sprite) using its grid location within that larger image. We also reviewed the PackedSpriteSheet class, which enables us to handle a sprite sheet that is made up of images that have different sizes and dimensions.
In this chapter, we build on the Image, SpriteSheet, and PackedSpriteSheet classes we now have and create an Animation class. This class enables you to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access