Akarsh M
Akarsh M

Reputation: 1611

how can we use the Animation and move on a sprite simultaneously in cocos2d-android?

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 ??

Upvotes: 0

Views: 1021

Answers (1)

Sebastian Ärleryd
Sebastian Ärleryd

Reputation: 1824

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.

Upvotes: 1

Related Questions