Quantcast
Channel: CoderzHeaven » Cocos2D
Viewing all articles
Browse latest Browse all 10

Pause And Resume iPhone Game Using Cocos2D

$
0
0

More than usually we need to apply the functions of Pause and Resume/Play for our games. In Mac’s cocos2D programming it’s more than simple. Simply use the following code for Pause & Resume where ever you want!

/*For Pausing the game*/

[[CCDirector sharedDirector] pause];
[self pauseSchedulerAndActions]; //Call for pausing all schedulers and actions

/*For Resuming/Playing back the game*/

[[CCDirector sharedDirector] resume];
[self resumeSchedulerAndActions]; // Call for resuming all schedulers and actions

:)


Viewing all articles
Browse latest Browse all 10

Trending Articles