IOS Dev (66) A basic consideration of a mobile game program
- Blog: http://blog.csdn.net/prevention
- Tai Rui elder brother
- From
Learn iPhone and iPad cocos2d Game Development
1 Handler program initiation within the basic process
applicationDidFinishLaunching
Program cut to the background
applicationDidEnterBackground
Program Run End
applicationWillTerminate
2 basic settings allow users to set device orientation
Animation Frame Period
[[CCDirector sharedDirector] setAnimationInterval:1.0/60];
It is your responsibility to keep the game running at a high frame rate.
When you set a lower frame rate, and the game can be kept steady at this frame rate, the user experience is much better than using a higher but unstable frame rate.
Ideally, your game should run at a frame rate of 60 frames per second, especially those action games. There are some games, such as most puzzle games, 30 frames per second to meet the requirements.
View FPS
[[CCDirector sharedDirector] setDisplayFPS:YES];
The difference between a log in Debug and Release
Use Cclog, do not use NSLog, the latter in release version will also exist, affecting the program to run.
3 Some introductory knowledge point type conversion defensive programming
CCNode* node = [self getChildByTag:13];// 防御性编程:验证返回的节点是CCLable类的对象NSAssert([node isKindOfClass:[CCLabel class]], @"node is not a CCLabel!");
What configuration test software is used?
When testing, try to use the Release configuration, do not use the Debug configuration.
-
reprint Please specify from: Http://blog.csdn.net/prevention