I am new to cocos2D can anyone suggest an easy solution to the problem?
I have a windmill with 8 bars on the windmill with each bar separated by 45 degrees, where half o
To make a CCSprite to rotate forever you could use something like
[windmill runAction:[CCRepeatForever actionWithAction:[CCRotateBy actionWithDuration:5.0 angle:360]]];
then add any CCSprite as a child it will rotate too. The position that you assign to a child is based on his parent, take that in account.
EDIT 1
Well, if you know the radius of the circle you can make some maths and get the position that you want. But also, if you don't need to calculate the positions, just try & error to get what you want. Try with the windmill without rotation.
You declare your action, "rot" as an instance of CCRotateBy yet when you allocate it, you begein with [CCRepeatForever[...]];
If you wanted you could do
CCRotateBy *rot = [CCRotateBy actionWithDuration:5 angle:360];
[windmill runAction:[CCRepeatForever actionWithAction:rot]];