Hello I am making a side scrolling cocos2d game. I have one class subclassed from CCLayer and other classes subclassed from CCSprite and CCNode. Can I use the ccTouch methods in the classes subclassed from CCSprite and CCNode, or can they only be in the class subclassed from CCLayer?
Try this
[[[CCDirector sharedDirector] touchDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
and call
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
return YES;
}