14 Animation
This chapter is about animation—specifically, traditional image animation. On a very simple level, you can think of this like a flip-book: a series of images, each slightly different from the previous one, that are shown in succession. The user sees each image for a short amount of time and experiences the illusion of movement. Animation provides a good opportunity for building a class because the mechanics of displaying the images over time are well understood and easily coded.
To show the general principles, we’ll begin by implementing two animation classes: a SimpleAnimation
class based on a series of individual image files, ...
Get Object-Oriented Python 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.