IOS Dev (66) A basic consideration of a mobile game program

Source: Internet
Author: User

IOS Dev (66) A basic consideration of a mobile game program
    • Blog: http://blog.csdn.net/prevention
    • Tai Rui elder brother
    • FromLearn 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.