Saturday, 30 May 2009

cocos2d - Action isDone always FALSE

Hi all,

i am facing some trouble using cocos2d AtlasAnimation problem. I want to start some death player death animation and perform some actions when this animation is finished. Problem is, that isDone func never returns TRUE, even after animation is finished.

I initialize it like this:
AtlasAnimation *anim_ball_glow = [AtlasAnimation animationWithName:@"glow" delay:0.1f];

//// here is adding of frames.......

id action_ball_glow = [Animate actionWithAnimation: anim_ball_glow];
[action_ball_glow setTag:8];
[ball runAction:action_ball_glow];

now, somewhere else in the code, i,m doing this:

// animation finish controls
if([[ball getActionByTag:8] isDone])
// do something

but this is never performed. isDone always returns FALSE. If I call something like this:

[[ball getActionByTag:8] stop]

it works. So I think that there is not problem with obtaining action. So, why isDone is always false?

Thanks a lot

No comments:

Post a Comment