(void) applicationDidFinishLaunching:(UIApplication*)application
{
[应用程序 setIdleTimerDisabled:YES];
self.notifyCenter=[NSNotificationCenter defaultCenter];
[notifyCenter addObserver:self 选择器:@selector(trackNotifications:) name:nil object:nil];
// 告诉 UIDevice 在方向改变时发送通知
// CC_DIRECTOR_INIT()
//
// 1. 初始化一个 0-bit 深度格式的 EAGLView,和 RGB565 渲染缓冲区
// 2. EAGLView 多次触摸:禁用
// 3. 创建一个 UIWindow,并将它分配给“window”变量(它必须已经被声明)
// 4.父母EAGLView到新创建的窗口
// 5. 创建显示链接控制器
// 5a。如果失败,它将使用 NSTimer 控制器
// 6. 它将尝试以 60 FPS 运行
// 7. 显示 FPS: NO
// 8. 设备方向:纵向
// 9. 将 director 连接到 EAGLView
//
CC_DIRECTOR_INIT();
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self 选择器:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object:nil];
// Obtain the shared director in order to...
CCDirector *director = [CCDirector sharedDirector];
// 设置横向模式
[导演setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
// 开启显示FPS
[导演setDisplayFPS:NO];
//开启多点触控
EAGLView *view = [导演 openGLView];
[查看 setMultipleTouchEnabled:YES];
// PNG/BMP/TIFF/JPEG/GIF 图像的默认纹理格式
// 可以是RGBA8888、RGBA4444、RGB5_A1、RGB565
// 你可以随时更改。
[CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];
状态=1;
state2=1;
Start *start=[起始节点];
[[CCDirector sharedDirector] runWithScene: start];