摘要: 在SpaceManager中关于运动物体的碰撞监测卡了一上午,终于调了出来,mark一下。情况是这样的,除了通过SpaceManager模拟物体在物理世界的运动外,还有一个Enemies类的运动轨迹需要自己定义,这个也好办,schedule定义就是了。- (void)enemiesMoving:(ccTime)dt{ CGPoint end = [[[_enemy stepArray] objectAtIndex:[_enemy curPointNum]+1] CGPointValue]; CGFloat disX,disY; float dis = [self distan... 阅读全文
posted @ 2012-05-04 00:41 Andy Wang 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 关于什么是适配器,一张图足以说明。现在实现一下简单的适配器模式。现有的系统是WildTurkey,封装的目标厂商类是Duck。分别看看这两者WildTurkey@protocol TurkeyProtocol <NSObject>@required- (void) gobble;- (void) fly;@end@interface WildTurkey : NSObject <TurkeyProtocol>{ }- (void) gobble;- (void) fly;@end@implementation WildTurkey- (void) gobble{ NSL 阅读全文
posted @ 2012-05-04 00:19 Andy Wang 阅读(184) 评论(0) 推荐(0) 编辑