I used CCSpeed action in cocos2d iPhone game. But crashes all the time.
CCAnimation* animation = nil;
animation = [[CCAnimationCache sharedAnimationCache] animationByName:ATTACK_ANIM];
if(animation)
{
CCAnimate *animAction = [CCAnimate actionWithAnimation:animation];
id speed = [CCSpeed actionWithAction:animAction speed:0.13f];
id calBlock = [CCCallBlock actionWithBlock:^{
//[self updateState:kTileState_Idle];
}];
CCSequence *sequence = [CCSequence actions:speed, calBlock, nil];
[self runAction:sequence];
}
But below code works fine..but not able to change animation speed. What's wrong with above code?
CCAnimation* animation = nil;
animation = [[CCAnimationCache sharedAnimationCache] animationByName:quakeAnim];
if(animation)
{
CCAnimate *animAction = [CCAnimate actionWithAnimation:animation];
id calBlock = [CCCallBlock actionWithBlock:^{
//[self updateState:kTileState_Idle];
}];
CCSequence *sequence = [CCSequence actions:animAction, calBlock, nil];
[self runAction:sequence];
}
Here is one anther thread. But no code solution provided.