Book Image

Learning iPhone Game Development with Cocos2D 3.0

By : Kirill Muzykov
Book Image

Learning iPhone Game Development with Cocos2D 3.0

By: Kirill Muzykov

Overview of this book

Table of Contents (19 chapters)
Learning iPhone Game Development with Cocos2D 3.0
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Starting the Action

In this chapter, we're going to add some action in the game and at the end of the chapter, we will be able to finally play the game. We will make our hunter aim for the bird using a finger and gyroscope, shoot the arrow from the bow, and make the arrow fly and hit the bird. Then we'll add more birds to the game as well as the winning and losing conditions.

In this chapter, we will learn the following topics:

  • Detecting when the player touches the screen, moves, and lifts the finger

  • Rotating the hunter's torso to aim at the desired point

  • Detecting collisions between two sprites using bounding boxes

  • Using states to control objects and the game life cycle

  • Detecting winning and losing

  • Using device orientation to control the game