Book Image

Learning iPhone Game Development with Cocos2D 3.0

By : Kirill Muzykov
Book Image

Learning iPhone Game Development with Cocos2D 3.0

By: Kirill Muzykov

Overview of this book

Table of Contents (19 chapters)
Learning iPhone Game Development with Cocos2D 3.0
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Animating using actions


Although frame-based animation looks really cool, sometimes you don't want to use it. Maybe you want to save some memory or you just don't have a designer friend and if you are as bad at drawing as I am, then maybe it is better not to try to draw the animation by yourself.

Besides that, in some cases, using frame-based animation is complete overkill. Remember our bird flying around from one side of the screen to another? We could create an animation with each frame equal to the width of the screen and move the bird, just like we did with exploding coconut pieces.

Fortunately, instead of doing this, we can just change the bird's position property or use the CCActionMoveTo action. We will achieve the same effect with less effort and without wasting any disk or memory space.

Tip

In game development, it is always a good idea to think about the best way to achieve the desired goal with minimum efforts. Being a good game developer is sometimes similar to being a good illusionist...