Hi guys,
I am using the 1.0 RC3 cocos. I have Subclassed from CCLayer to make a user input layer but when I try to catch multi touch events I don't get them. I am using the function below to catch the touches. I only get the first touch. Does anyone know what I am doing wrong?
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
//Add a new body/atlas sprite at the touched location
CGPoint location = [touch locationInView: [touch view]];
location = [[CCDirector sharedDirector] convertToGL: location];
if (CGRectContainsPoint(jumpRect, location)) {
[player jump];
NSLog(@"JUMP");
}
if (CGRectContainsPoint(leftRect, location)) {
[player move:b2Vec2(-8, 0)];
NSLog(@"MOVE LEFT");
}
if (CGRectContainsPoint(rightRect, location)) {
[player move:b2Vec2(8, 0)];
NSLog(@"MOVE RIGHT");
}
return TRUE;
}