注册

一个简单的俄罗师方块


简单的俄罗师方块下面是部分程序,我把整体的上传到附件了
#import

#import "AppController.h"

#import "cocos2d.h"

#import "EAGLView.h"

#import "AppDelegate.h"




#import "RootViewController.h"




@implementation AppController




@synthesize window;

@synthesize viewController;




#pragma mark -

#pragma mark Application lifecycle







static AppDelegate s_sharedApplication;




- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {




    // Override point for customization after application launch.




    // Add the view controller's view to the window and display.

    window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];

    EAGLView *__glView = [EAGLView viewWithFrame: [window bounds]

                                     pixelFormat: kEAGLColorFormatRGBA8

                                     depthFormat: GL_DEPTH_COMPONENT16

                              preserveBackbuffer: NO

                                      sharegroup: nil

                                   multiSampling: NO

                                 numberOfSamples:0 ];




    // Use RootViewController manage EAGLView

    viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];

    viewController.wantsFullScreenLayout = YES;

    viewController.view = __glView;




    // Set RootViewController to window

    if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)

    {

        // warning: addSubView doesn't work on iOS6

        [window addSubview: viewController.view];

    }

    else

    {

        // use this method on ios6

        [window setRootViewController:viewController];

    }

    

    [window makeKeyAndVisible];




    [[UIApplication sharedApplication] setStatusBarHidden: YES];




    cocos2d::CCApplication::sharedApplication()->run();

    return YES;

}







- (void)applicationWillResignActive:(UIApplication *)application {

        cocos2d::CCDirector::sharedDirector()->pause();

}




- (void)applicationDidBecomeActive:(UIApplication *)application {

   

    cocos2d::CCDirector::sharedDirector()->resume();

}




- (void)applicationDidEnterBackground:(UIApplication *)application {

    

    cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground();

}




- (void)applicationWillEnterForeground:(UIApplication *)application {

    

    cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground();

}




- (void)applicationWillTerminate:(UIApplication *)application {

    }







#pragma mark -

#pragma mark Memory management




- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {

    

     cocos2d::CCDirector::sharedDirector()->purgeCachedData();

}







- (void)dealloc {

    [super dealloc];

}







@end
 

1 个评论

好奇 哪儿搞来的

要回复文章请先登录注册