-(void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event
{
_nextProjectile = [[CCSprite spriteWithFile:@"arrow.png"]retain];
_nextProjectile.position = imgArrow.position;
[imgArrow runAction:[CCSequence actions:
[CCRotateTo actionWithDuration:rotateDuration angle:cocosAngle],
[CCCallFunc actionWithTarget:self selector:@selector(finishShoot)],
nil]];
//Some code
}
- (void)finishShoot {
// Ok to add now - we've finished rotation!
[self addChild:_nextProjectile];
[_projectiles addObject:_nextProjectile];
// Release
[_nextProjectile release];
_nextProjectile = nil;
}
When I click on bow twice my arrow overlaps one over another.
any help ?!