Hi,
I've got a problem with stopping actions from a subclassed CCSprite:
I run a action in this way:
vehicle.position = ccp(0,0);
CGPoint targetPoint = ccp(480,320);
id moveAction = [CCMoveTo actionWithDuration:10.0 position:targetPoint];
[vehicle runAction:moveAction];
And I want to stop the action via a touch, so i implemented the CCTargetedTouchDelegate
in my CCSprite Subclass:
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
if (self.touchable) {
[self stopAllActions];
NSLog(@"I GOT TOUCHED!");
}
return self.touchable;
}
I can read the "I GOT TOUCHED!" in console, but sprite is still moving, whats wrong here?
Thank you for your help.