摘要: 你将会学习一些与cocos2d配合使用的工具,比如Particle Designer。 没有这些工具,你只能成为“半个”cocos2d开发者。cocos2d 整合了两套物理引擎。一套叫 Chipmunk,另一套叫 Box2d。它们的功 能基本相同,最大的区别是编写它们所使用的编程语言:Chipmunk 是用 C 写的, Box2d 是用 C++写的。游戏开发者喜欢 cocos2d 的一个原因是它隐藏了底端的 OpenGL ES 代码。其他的一些 iOS 游戏引擎,比如 Unity, iTorque 和 Shiva 专注于提 供工具和流程以降低对编程知识的要求。你可以在此下载 cocos2d:h 阅读全文
posted @ 2013-01-08 08:47 diablo大王 阅读(174) 评论(0) 推荐(0) 编辑
摘要: - (void)testWithString:(NSString *)ss{ CCLOG(@"test = %@",ss);}SEL sl = @selector(testWithString:);[selfperformSelector:sl withObject:@"yinJiDong"];CCLOG(@"method = %@",NSStringFromSelector(sl));test = yinJiDongmethod = testWithString: 阅读全文
posted @ 2013-01-07 10:59 diablo大王 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 下载后,解压,在命令行窗口执行./install-templates.sh 阅读全文
posted @ 2013-01-05 13:40 diablo大王 阅读(118) 评论(0) 推荐(0) 编辑
摘要: int urn[SIZE]; urn[0] = 100; urn[1] = 200; urn[2] = 300; urn[3] = 400; urn[4] = 500; int *ptr1,*ptr2,*ptr3; ptr1 = urn; ptr2 = &urn[2]; printf("当前指针的值和地址 "); printf("ptr1 = %p, *ptr1 = %d, &ptr1 = %p\n",ptr1,*ptr1,&ptr1); ptr3 = ptr1 + 4; printf("ptr1 + 4 = %p, * 阅读全文
posted @ 2013-01-05 11:28 diablo大王 阅读(2164) 评论(0) 推荐(0) 编辑
摘要: 数组名同时也是该数组首元素的地址。#define SIZE 4short dates [SIZE]; dates[0] = 1; dates[1] = 2; dates[2] = 3; dates[3] = 4; short *pti; double bills[SIZE]; bills[0] = 1.1; bills[1] = 2.2; bills[2] = 3.3; bills[3] = 4.4; double *ptf; short index; pti = dates; ptf = bills; printf("%23s %10s\n","sho... 阅读全文
posted @ 2012-12-27 15:44 diablo大王 阅读(139) 评论(0) 推荐(0) 编辑
摘要: int main(int argc, const char * argv[]){ int numbers[3]; numbers[0] = 1; numbers[1] = 2; numbers[2] = 3; printf("sizeof(numbers) is = %lu\n",sizeof(numbers)); printf("sizeof(numbers[0])is = %lu\n",sizeof(numbers[0])); for (int i= 0; i<sizeof(numbers)/sizeof(numbers[0]); i++) { 阅读全文
posted @ 2012-12-27 15:26 diablo大王 阅读(142) 评论(0) 推荐(0) 编辑
摘要: iPhone 4S 屏幕信息// [[UIApplicationsharedApplication] setStatusBarHidden:YES]; 状态栏占20高度UIScreen *currentScreen = [UIScreenmainScreen];NSLog(@"applicationFrame.size.height = %f",currentScreen.applicationFrame.size.height);NSLog(@"applicationFrame.size.width = %f",currentScreen.applic 阅读全文
posted @ 2012-12-27 14:11 diablo大王 阅读(5085) 评论(0) 推荐(0) 编辑
摘要: UIDevice *currentDevice = [UIDevicecurrentDevice]; NSLog(@"Device's name = %@",currentDevice.name); NSLog(@"Device's identifierForVendor = %@",currentDevice.identifierForVendor); NSLog(@"Device's uniqueIdentifier = %@",currentDevice.uniqueIdentifier); NSLog( 阅读全文
posted @ 2012-12-27 13:55 diablo大王 阅读(165) 评论(0) 推荐(0) 编辑
摘要: int *i; //定义一个整型数字的指针变量 iint p = 34; i = &p;printf("i value = %d ,address = %p",*i,i);return0;i value = 34 ,address = 0x7fff5fbff854#include <stdio.h>#include <ctype.h> // 包括字符处理函数void swap(int *i,int *p);int main(int argc, const char * argv[]){ int i = 5; int p = 10; print 阅读全文
posted @ 2012-12-26 15:48 diablo大王 阅读(171) 评论(0) 推荐(0) 编辑
摘要: C语言中的指针,是用来存储变量地址。int i = 34;printf("i = %d, address = %p",i,&i);i = 34, address = 0x7fff5fbff85c 阅读全文
posted @ 2012-12-26 15:35 diablo大王 阅读(374) 评论(0) 推荐(0) 编辑