Book Image

Cocos2d Game Development Blueprints

By : Jorge Jordán
Book Image

Cocos2d Game Development Blueprints

By: Jorge Jordán

Overview of this book

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

Chapter 2. Explosions and UFOs

One of the most interesting characteristics in iOS devices is the accelerometer, thanks to which you can, among other functionalities, control the movement of the main character of a game without needing to touch the screen. In this chapter, you will learn how to take advantage of this feature and mix it with particles such as explosions and fire to develop a classic shoot 'em up game like 1942, but in this case, the enemies will be UFOs. As you will need some spaceships, you will learn how to create them by extending the CCSprite class and I will also teach you how to implement the parallax effect to create an illusion of depth in a 2D game. To conclude, I will introduce you to geometric primitives such as lines, squares, and circles and how to draw them.

Things you will learn in this chapter include:

  • How to use the accelerometer

  • How to load and set up a particle system

  • How to create sprites that extend CCSprite

  • How to implement the parallax effect in a 2D game...