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

Navigating between scenes


Now, when we have all those buttons on the menu scene, we should make them work. In the early chapters of the book, we discussed the significance of the CCDirector class. We have already used some of its properties, and of course, we have used the replaceScene: method to load the game scene when you tap on the Start button.

With replaceScene:, everything should be quite clear. You create a new scene and pass it to the replaceScene: method, and now, this new scene is running and the old one is terminated and deallocated.

In this part of the chapter, we are going to use another method of the CCDirector class called pushScene. This method can be used to display the scene without deallocating the currently running scene. In addition, we are going to use the CCTransition class for a smooth transition between scenes, and of course, we are going to add more scenes to our game.