0
votes

I am working on cocos2d-iPhone. I want to rotate stars with respect to its y Axis like it is in CUT THE ROPE game. I know we can rotate star to its x axis simply by ccRotateto action. Here is the link of CUT THE ROPE GAME.

http://www.youtube.com/watch?v=qoYJMaGPas4

In this link all the stars are rotating at its Y axis. You can see that in first star as it is steady.

Anyone has any idea how can we implement this??

2

2 Answers

2
votes

Cocos2D has the CCOrbitCamera action that might work for you:

[[CCDirector sharedDirector] setProjection:kCCDirectorProjection3D];

CCOrbitCamera *orbit = [CCOrbitCamera actionWithDuration:1.0f radius:1 deltaRadius:0 angleZ:0 deltaAngleZ:360 angleX:0 deltaAngleX:0];

[mySprite runAction: orbit];

You can modify the angles to get the effect you're looking for.

0
votes

that is done by animation frames. you need to have the rotation animation frames and you can run animation with frames to get that effect.