hi,
I am writing a game in iPad using cocos2d.
I need to mix two actions,
One action is, to get the rotation of the object. I have 10 images of the rotation of an object. When we animate them we get the rotation of the object.
Second action is to move the object from one edge to other edge. I am able to get one action after the other.
But I need both actions at same time.
The object should rotate while it moves from one edge to opposite edge. How can I mix both the animations.
Thank You.
views:
54answers:
2
A:
I have 10 images of the rotation of an object. When we animate them we get the rotation of the object.
You're halfway there.
Modify the images so that they go from edge to edge. Model both the rotation and the movement with your images. You'll probably need more than 10, though.
That way, you only have one animation to perform.
Gilbert Le Blanc
2010-07-15 11:27:56
@Gilbert, Sorry I have a doubt. "Modify the images so that they go from edge to edge"- this particular one I am not clear. Can you please explain a bit more.Thank You.
srikanth rongali
2010-07-15 11:49:06
@srikanth rongali: Let's assume you want the animation to go from left to right across the screen. The x dimension of your image files need to be expanded so each image is as wide as the screen.
Gilbert Le Blanc
2010-07-15 13:58:24
A:
I hope this may help
[sprite runAction:[CCSpawn actions:action1, action2, nil]]
or try this when u got only 2 actions
[sprite runAction:[CCSpawn actionOne:action1 two:action2]]
or you can do like this
[sprite runAction:action1];
[sprite runAction:action2];
5upr1
2010-07-15 12:04:03