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

Introduction


Adding animations into our games using SpriteKit is an easy task, as we did in the previous chapter, where we added some SKAction functions to get the spaceship to move. These were the animations related to their movement, orientations, and somewhat related to their transformations. However, now the animation that we are going to talk about is the content change of a sprite. Animations will be animating multiple images (that is, frames) of the same sprite multiple times per second, giving a feel of being alive for the sprite. This is somewhat similar to the way we capture the videos, it's just a sequence of the snapshots per second. These types of animations need a lot of images to be accomplished thereby increasing the memory size for these textures. The texture is represented by a SKTexture object created and attached with the sprite. Texture object automatically loads the sprite data (called Texture data) whenever it is visible and is used to render the sprite in the respective...