Animation and move the sprite of one position to another position is done but simultaneously not working. Anyone have an idea, how can I resolve it ??
Asked
Active
Viewed 1,017 times
0
-
run a move, then run an animate action. Should work. What have you tried? – CodeSmile Feb 25 '13 at 20:50
-
i tried like this : sprite.runAction(CCSequence.actions(action, actionMove,action_back )); – Akarsh M Feb 27 '13 at 10:29
-
1now its work fine through this : sprite.runAction(action); sprite.runAction(actionMove); sprite.runAction(action_back); – Akarsh M Feb 27 '13 at 10:31
-
have you any idea cz both things are same but one is working fine and another not ?? – Akarsh M Feb 27 '13 at 10:32
-
1sequence != simultaneous. The sequence runs actions one after the other. Calling runAction multiple times runs the actions in parallel (simultaneously). – CodeSmile Feb 27 '13 at 19:57
-
thanks for the explaining this thing ... – Akarsh M Feb 28 '13 at 04:51
1 Answers
1
As stated in the comments to your question, you can simply call runAction once for every action you want to run and they will run in parallel, like so
sprite.runAction( action );
sprite.runAction( actionMove );
sprite.runAction( action_back );
If you would want to combine your actions into one parallel action, use CCSpawn
CCFiniteTimeAction parallelAction = CCSpawn.actions( action, actionMove, action_back );
sprite.runAction( parallelAction );
Now, running parallelAction will run action, actionMove and action_back in parallel.

Sebastian Ärleryd
- 1,774
- 14
- 19