i have written code for animation but it just perform 1st time sprites collide. Later nothing happens i dnt knw what wrong ,
code is
(
id anim2=[[[Animation alloc] initWithName:@"elf-mad08.png" delay:0.2] autorelease];
[anim2 addFrameWithFilename:@"elf-mad09.png"];
[anim2 addFrameWithFilename:@"elf-mad10.png"];
[anim2 addFrameWithFilename:@"elf-mad11.png"];
Action *action1=[Animate actionWithAnimation:anim2];
Action *action2=[FadeOut actionWithDuration:0.1];
[persistance_obj playSound:6];
sp1.texture =[[TextureMgr sharedTextureMgr]addImage:@"elf-mad08.png"];
sp1.position=g.giftBody->body->p;
sp1.visible=TRUE;
[value setString:[NSString stringWithFormat:@"-%d",rdcgmscr]];
value.position=cpv(g.giftBody->body->p.x-50,g.giftBody->body->p.y-10);
[value runAction:[FadeOut actionWithDuration:0.5]];
g.giftBody->body->p=cpv(800,0);
//sp2.visible=TRUE;
[sp1 runAction:[Sequence actions:action1,action2,nil]];
)
can any one help
and i am using same sp1 sprite to do amimation on collision with other sprites also.