O'Reilly logo

Cocos2d for iPhone 0.99 Beginner's Guide by Pablo Ruiz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - animating the stones

We are going to bring those stones to life. For that, we first have to put all the frames that will make our animations into a spritesheet, load them, and then use them to create a CCAnimation action, which we'll repeat over and over again.

You can find all the images for the frames in the Chapter 3 companion files or make your own. Just remember a couple things when doing your own animations:

  • Whenever possible try to make all the frames the same size, as this will make life easier for you when running the animations. If you have different sized frames and the frames are not even centered, the animation will look jumpy and you would have to adjust their positions or offsets.
  • Create the least possible number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required