Book Image

Cocos2d-X Game Development Blueprints

By : Karan Sequeira
Book Image

Cocos2d-X Game Development Blueprints

By: Karan Sequeira

Overview of this book

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

Chapter 2. How to Fly a Dragon!

This is the story of a dragon trapped inside a castle. You might ask why would a mighty creature like a dragon be trapped inside a castle. Well, obviously because he has deformed wings that are too small to carry his weight! It's our duty to help this poor creature out of this horrendous castle! We will continue using Cocos2d-html5 to create this charming game about a dragon trying to escape the bounds of the castle, with the player tapping to help the dragon fly. We'll call this game DragonDash.

In this chapter, you'll learn:

  • How to load a sprite sheet

  • How to create and use a cc.Animation

  • How to implement simple gravity and rectangular collision detection

  • How to play HTML5 audio and persistently store data in the browser

This is what we will achieve by the end of this chapter: