O'Reilly logo

Cocos2d for iPhone 1 Game Development Cookbook by Nathan Burba

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required