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

Time for action – adding angry birds


At the moment, the stones are just launched from the air. Of course, if we move the stone's spawning point above the screen, we can imagine that there are some birds flying high and dropping the stones.

Note

In fact, we placed the launch point below the screen edge so that you can see them being launched.

However, wouldn't it be cooler to see your enemy, to look them in the eyes? Let's do this and add some birds that are dropping stones.

What we're going to do is to spawn a bird off the screen. The bird will carry a stone using a joint.

Note

Joints are constraints that used to simulate interaction between objects. For example, you can simulate one object tied with a rope to another one. It will become clear in a moment.

This bird will fly into the level and will drop the stone at the target point.

  1. To keep things organized, create a new Objective-C class in the GameObjects group. Name the class PhysicsBird and make it a subclass of our Bird class, as we're going...