Skip to main content
more note
Source Link
Emadpres
  • 940
  • 7
  • 25

Use this code (cocos2dx v3.x):

node->runAction( Sequence::create( Spawn::create(A, B, nullptr),
                                    C,
                                    nullptr));

This is what happen:

  1. A and B start simultaneously
  2. After the longer one finished, C start.

Important: Remember that you should use finite action when using Sequence. for example you should not use RepeatForever for actions when use them in Sequence.


cocos2d v2.x

node->runAction( CCSequence::create( CCSpawn::create(A, B, NULL),
                                    C,
                                    NULL));

Use this code:

node->runAction( Sequence::create( Spawn::create(A, B, nullptr),
                                    C,
                                    nullptr));

This is what happen:

  1. A and B start simultaneously
  2. After the longer one finished, C start.

Use this code (cocos2dx v3.x):

node->runAction( Sequence::create( Spawn::create(A, B, nullptr),
                                    C,
                                    nullptr));

This is what happen:

  1. A and B start simultaneously
  2. After the longer one finished, C start.

Important: Remember that you should use finite action when using Sequence. for example you should not use RepeatForever for actions when use them in Sequence.


cocos2d v2.x

node->runAction( CCSequence::create( CCSpawn::create(A, B, NULL),
                                    C,
                                    NULL));
Source Link
Emadpres
  • 940
  • 7
  • 25

Use this code:

node->runAction( Sequence::create( Spawn::create(A, B, nullptr),
                                    C,
                                    nullptr));

This is what happen:

  1. A and B start simultaneously
  2. After the longer one finished, C start.