Creating a loading screen with an indicator

Games with large levels often incur long load times. If level elements can be loaded in asynchronous steps, then we can give the user some reassuring feedback that the game is still loading and hasn't crashed.

Creating a loading screen with an indicator

Getting ready

Please refer to the project RecipeCollection02 for full working code of this recipe.

How to do it...

Execute the following code:

/* The actual 'game' class where we display the textures we loaded asynchronously */ @implementation GameScene +(id) sceneWithLevel:(NSString*)str { //Create our scene CCScene *s = [CCScene node]; GameScene *node = [[GameScene alloc] initWithLevel:str]; [s addChild:node ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.