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

Handling the accelerometer input


Since the apparition of the first iPhone generation, mobile devices are equipped with a 3-axis accelerometer (x, y, and z) to detect orientation changes and it has modified the course of handheld games. It allows players to interact with games without the need to touch the screen, and it allows developers to create new subgenres of games too.

Throughout this chapter, you will mix this hardware feature with a classic arcades genre to develop the following game: the planet Earth has been attacked by an army of UFOs whose sole purpose is to wipe out all of mankind, but fortunately, a mad scientist equipped with some of his inventions is brave enough to defend us.

To control the movements of Dr. Nicholas Fringe, our mad scientist, you will take advantage of the accelerometer, but first of all you need a clean Xcode project. As you learned in the previous chapter how to create a new project and how to get it ready to start developing, we will skip this step, so...