Skip to Main Content
Learning iPhone Game Development with Cocos2D 3.0
book

Learning iPhone Game Development with Cocos2D 3.0

by Kirill Muzykov
June 2014
Beginner to intermediate content levelBeginner to intermediate
434 pages
9h 49m
English
Packt Publishing
Content preview from Learning iPhone Game Development with Cocos2D 3.0

Time for action – launching stones

It doesn't take too much time to win our game right now. Just take one step to the left or right and the stone will fall without hitting the hunter. If this is the punishment for shooting birds, then our hunter isn't going to learn anything.

It is time to throw more stones and make them fall at different places to make the hunter run around the level to avoid being hit by stones. Perform the following steps:

  1. Open the PhysicsScene.m file, add _timeUntilNextStone, and add the _stones array instance variables, as shown in the following code:
    @implementation PhysicsScene
    {
        //..skipped..
        float _timeUntilNextStone;
        NSMutableArray *_stones;
    }
  2. Add the following code to initialize the array and the time counter in the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Swift Games Development for iOS: Develop 2D and 3D games Using Apple's SceneKit and SpriteKit

Beginning Swift Games Development for iOS: Develop 2D and 3D games Using Apple's SceneKit and SpriteKit

James Goodwill, Wesley Matlock

Publisher Resources

ISBN: 9781782160144Supplemental Content