-(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;
}
当我点击弓两次时,我的箭头重叠在一起。
有什么帮助吗?!