Chapter    23

Animation

In this chapter, you will see how to add animations to your game. In the games you’ve developed until now, game objects could move around on the screen, but adding something like a running character to a game is slightly more challenging. In this chapter, you will write a program that contains a character walking from left to right on the screen. The character is controlled by the player pressing left and right buttons on the screen.

What Is Animation?

Before you look into how to program a character walking around on the screen, you first have to think about what animation is. To grasp this, you have to go back to the 1930s, when several animation studios (among them Walt Disney) produced the first cartoons in black and ...

Get Swift Game Programming for Absolute Beginners now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.