Actor State and Animations

Now that we have a basic set of animations, it is time to add a little life to actors. We are going to expand on the last examples and add two effects. The first is to make the asteroids look like they are tumbling through space. The second is to make the spaceship rotate before moving. Both of these techniques will update the image used to represent each actor to create the visual effect. We will also add some state logic to the spaceship to we can keep track of what the ship should be dong, staying put, rotating, or traveling to the target point. Figure 5–10 shows this next example in action.

Image

Figure 5–11. Adding ...

Get Beginning iOS 5 Games Development: Using the iOS 5 SDK for iPad, iPhone, and iPod Touch 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.