We already saw
Actions in action while animating and repeating the player animation. However, there are a lot more additional actions that you can perform. Further, you can play these actions together in a sequence.
Let's first take a look at a simple action in which we will move the hero along the x axis by half the width of the screen, and move it down by one-quarter the height of the screen from the center in the
After we have added the hero to
MainScene, we will add the following code:
CGPointfinalPos = CGPointMake(center.x + winSize.width/4, center.y - winSize.height/4); CCActionFiniteTime* actionMove = [CCActionMoveToactionWithDuration:1.0position:finalPos]; [herorunAction:actionMove]; ...