Book Image

Cocos2d-x by Example: Beginner's Guide

By : Roger Engelbert
Book Image

Cocos2d-x by Example: Beginner's Guide

By: Roger Engelbert

Overview of this book

Table of Contents (19 chapters)
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Fun with Sprites – Sky Defense

Time to build our second game! This time, you will get acquainted with the power of actions in Cocos2d-x. I'll show you how an entire game could be built just by running the various action commands contained in Cocos2d-x to make your sprites move, rotate, scale, fade, blink, and so on. And you can also use actions to animate your sprites using multiple images, like in a movie. So let's get started.

In this chapter, you will learn:

  • How to optimize the development of your game with sprite sheets

  • How to use bitmap fonts in your game

  • How easy it is to implement and run actions

  • How to scale, rotate, swing, move, and fade out a sprite

  • How to load multiple .png files and use them to animate a sprite

  • How to create a universal game with Cocos2d-x