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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.