html

  • 博客:http://blog.csdn.net/prevention
  • 作者:大锐哥
  • 摘自:Learn iPhone and iPad cocos2d Game Development

1 基本流程内的 handler

程序启动

applicationDidFinishLaunching

程序切到后台

applicationDidEnterBackground

程序执行结束

applicationWillTerminate

2 基本设置

同意用户设置设备方向

[[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; 

动画帧周期

[[CCDirector sharedDirector] setAnimationInterval:1.0/60];

保持游戏执行在一个高的帧率上是你的责任。

当你设置了一个低一点的帧率, 并且游戏能够稳定的保持在这个帧率, 用户的体验会比使用一个高一些可是不稳定的帧率要好非常多。

理想状态下, 你的游戏应该执行在 60 帧每秒的帧率, 特别是那些动作游戏。有一些游戏, 比方大多数的益智游戏, 30 帧每秒就能够满足要求。

查看 FPS

[[CCDirector sharedDirector] setDisplayFPS:YES];

日志在 Debug 和 Release 中的差别

用 CCLog,不要用 NSLog,后者在 Release 版本号中也会存在,影响程序执行。

3 几点入门知识点

类型转换的防御性编程

CCNode* node = [self getChildByTag:13];
// 防御性编程:验证返回的节点是CCLable类的对象
NSAssert([node isKindOfClass:[CCLabel class]], @"node is not a CCLabel!");

用什么配置測试软件?

測试时。尽量用 Release Configuration。不要用 Debug Configuration。

转载请注明来自:http://blog.csdn.net/prevention

版权声明:本文为 CSDN 博主 大锐哥(ID 为 prevention)原创文章,未经博主同意不得转载。
举报
  • 本文已收录于下面专栏:
0条评论
<html>

Related Posts

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注