Book Image

iOS Game Programming Cookbook

Book Image

iOS Game Programming Cookbook

Overview of this book

Table of Contents (19 chapters)
iOS Game Programming Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Adding animations using a texture atlas


We have already learned about animations even before learning how to use textures for loading images from App Bundle. As we have a texture atlas (that is, a larger combined image), we will be loading the images by that texture atlas. All sprites added in the FSMyScene file are loaded by the images from the App Bundle, so now we will be loading all the images by the texture atlas in the sprite. Lastly, some animations will be applied to them using the texture atlas to load the images.

Getting ready

Before starting with the animations using a texture atlas to load images, we should know the process of creating a texture atlas using a combination of images and doing some animations of changing frame after a fixed delay. So here we will be doing the same animation of coin rotation we did earlier, but now using a texture atlas. This recipe will be called Adding animations using a texture atlas. After that we will animate a bunch of coins from one end to another...