O'Reilly logo

Learning Cocos2d-x Game Development by Siddharth Shekar

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

Chapter 6. Animations

In the last chapter, we saw how to bring the scene to life by adding a scrolling background. In this chapter, we will learn different tools that can be used to animate the character. Then, using these animations, we will create a simple state machine that will automatically check whether the hero is falling or is being boosted up into the air, and depending on the state, the character will be animated accordingly.

We will cover the following in this chapter:

  • Animation basics
  • TexturePacker
  • Creating spritesheet for the player
  • Coding the player animation
  • Creating and coding the enemy animation
  • Creating the skeletal animation
  • Coding the player walk cycle

Animation basics

First of all, let's discuss what animation is. An animation is made ...

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