【发布时间】:2013-04-25 03:35:33
【问题描述】:
这个问题已经困扰了我两个晚上,我不能简单地使用level helper collision 让两个LHSprites collide 相互使用。我已经多次检查docs 以检查我是否遗漏了什么,但我看不到它。
在 xCode 的控制台中,它会记录:
LevelHelper WARNING: Please call useLevelHelperCollisionHandling after addObjectsToWorld
2013-04-24 20:33:04.537 Monkeys2D[1322:c07]
LevelHelper WARNING: Please call registerPostCollisionCallbackBetweenTagA after useLevelHelperCollisionHandling
但是正如您在下面的代码中看到的那样,我正在正确地做它警告我我不是的事情。
-(id) init
{
if( (self=[super init])) {
self.isTouchEnabled = YES;
loader = [[LevelHelperLoader alloc]initWithContentOfFile:@"Level1"];
[loader addObjectsToWorld:world cocos2dLayer:self];
[loader useLevelHelperCollisionHandling];
[loader registerPostCollisionCallbackBetweenTagA:MONKEY andTagB:SINGLEBANANA idListener:self selListener:@selector(collision)];
}
return self;
}
我的问题是碰撞不会发生,当MONKEY 和SINGLEBANANA 碰撞时,它就像什么都没发生一样。
任何帮助将不胜感激!
【问题讨论】:
-
你能发布你的
collision方法吗? -
我记得随机得到同样的东西..尝试重置你的模拟器并清理你的项目..
标签: iphone ios cocos2d-iphone levelhelper