Book Image

Learning Cocos2d-x Game Development

By : Siddharth Shekar
Book Image

Learning Cocos2d-x Game Development

By: Siddharth Shekar

Overview of this book

Table of Contents (19 chapters)
Learning Cocos2d-x Game Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

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