user2121776
user2121776

Reputation: 121

Play animation after another animation on sprite

I've looked all over and i can't find any information on how to do this. I want to run an action animation then right after that animation is done i want it to run another action animation all on the same sprite. how is this possible?

    [self.mainShip runAction:retractdoor];
    [self.mainShip runAction:activatedoor];

this crashes me.

    self.mainShip runAction: [CCSequence actions:retractdoor,activatedoor, nil];

gives me a yellow notification

incompatible pointer types sending Cc action to parameter of type ccfinite time action

CCAnimation *retractdoorAnimation = [CCAnimation
                                         animationWithSpriteFrames:retractdoorframes delay:0.1f];
    CCAnimation *activatedoorAnimation = [CCAnimation
                                           animationWithSpriteFrames:activatedoorframes delay:0.1f];

self.retractdoorAction = [CCAnimate actionWithAnimation:retractdoorAnimation];
self.activatedoorAction = [CCAnimate actionWithAnimation:activatedoorAnimation];

Upvotes: 0

Views: 108

Answers (1)

Ultrakorne
Ultrakorne

Reputation: 1303

you missed the nil termination.

[self.mainShip runAction: [CCSequence actions:retractdoor,activatedoor, nil]];

this should work, dont use the square brackets and dont miss the comma..

Upvotes: 3

Related Questions