O'Reilly logo

Cocos2D Game Development Essentials by Ben Trengrove

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

Creating sprite frame animations

You may have noticed that there are three assets for the bird. These will be used to create a keyframe animation that will run in a loop. SpriteBuilder makes this process very simple:

  1. Create a new file that uses a sprite as its root object. Call it Bird.
  2. Select CSprite in the editor.
  3. In the options pane on the right-hand side of the screen, there is an option for Sprite frame. Set it to bird0.png.
    Creating sprite frame animations
  4. Now, in order to create the animation, select all the bird images in the resources pane on the left of the screen. Right-click on them and select Create keyframes from Selection.
  5. Notice that there has been three keyframes created ...

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