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 – pausing the game with a pause dialog

We will start with adding a pause dialog to allow the player to pause the game:

  1. Create a new group in Resources and call it Dialogs. Then, open the book's supporting files in Chapter_09/Assets/Dialogs and add all the images to that group.
  2. Create a new Objective-C class in the Scenes group. Name the class PauseDialog and make it a subclass of CCNode.

    Tip

    Note that it is a subclass of CCNode not CCScene. We have used a similar approach when we created the HUDLayer class. You can read Chapter 6, Rendering Text, to refresh your memory. We are going to use CCNode as a base class for all dialogs.

  3. Open the PauseDialog.h file and add the following property. It will allow the object, which creates the dialog ...
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