O'Reilly logo

Cocos2d for iPhone 0.99 Beginner's Guide by Pablo Ruiz

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

Time for action - taking a first look at the HelloCocos2dAppDelegate

The AppDelegate is the main entry point of your application. Here is where Cocos2d is initialized. There are a lot of useful things you can tweak from the Director in here to change the behavior of your application. Let's take a look.

@implementation HelloCocos2dAppDelegate @synthesize window; - (void) applicationDidFinishLaunching:(UIApplication*)application { // Init the window window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // cocos2d will inherit these values [window setUserInteractionEnabled:YES]; [window setMultipleTouchEnabled:YES]; // Try to use CADisplayLink director // if it fails (SDK < 3.1) use the default director if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] ...

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