Search code examples
iphoneioscocos2d-iphonelevelhelper

LevelHelper collision not working


This problem has stumped me for two nights now, I cannot simply have two LHSprites collide with each other using level helper collision. I have checked the docs multiple times to check if I was missing something, but i cannot see it.

In the console of xCode, it logs:

 LevelHelper WARNING: Please call useLevelHelperCollisionHandling after addObjectsToWorld
2013-04-24 20:33:04.537 Monkeys2D[1322:c07]
 LevelHelper WARNING: Please call registerPostCollisionCallbackBetweenTagA after useLevelHelperCollisionHandling

But as you can see in my code below, I am correctly doing what it is warning me that I am not.

-(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;
}

My problem is that the collision will NOT register, it acts as if nothing is even happening when the MONKEY and the SINGLEBANANA collide.

Any help would be greatly appreciated!


Solution

  • Turns out i needed to add an update method and implement some other box2d stuff, visit the level helper docs & forum to see.