IOS Dev (66) basic considerations for a mobile game program

Source: Internet
Author: User

IOS Dev (66) basic considerations for a mobile game program

  • Blog: http://blog.csdn.net/prevention
  • Author: darui Ge
  • From:Learn iPhone and iPad cocos2d Game Development
1. Start the handler program in the basic process.
applicationDidFinishLaunching
Switch the program to the background
applicationDidEnterBackground
Program running ended
applicationWillTerminate
2. Basic settings allow users to set device directions
[[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; 
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 maintain a stable frame rate, the user experience will be 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. Some games, such as most puzzle games, can meet the requirements by 30 frames per second.

View FPS
[[CCDirector sharedDirector] setDisplayFPS:YES];
Differences between logs in Debug and Release

Use CCLog instead of NSLog. The latter also exists in the Release version, which affects program running.

3. Defensive Programming for type conversion of knowledge points
CCNode * node = [self getChildByTag: 13]; // Defensive Programming: Verify that the returned node is the NSAssert object of the CCLable class ([node isKindOfClass: [CCLabel class], @ "node is not a CCLabel! ");
What configuration test software is used?

When testing, try to use Release Configuration instead of Debug Configuration.

-

Reprinted please indicate 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.