In the previous recipe, you learned some of the basic actions. However, you may want to use more complex actions; for example, rotating a character while moving, or moving a character after jumping. In this recipe, you will learn how to control actions.
Sequence is a series of actions to be executed sequentially. This can be any number of actions.
auto move = MoveBy::create(2.0f, Vec2(100, 0)); auto rotate = RotateBy::create(2.0f, 360.0f); auto action = Sequence::create(move, rotate, nullptr); sprite->runAction(action);
The preceding command will execute the following actions sequentially: