I'm new to cocos2D, can anyone suggest an easy solution to the problem?
I have a 8-bar windmill in a windmill with each bar divided by 45 degrees, where half of the windmill is on the screen and half is off the screen. I want to turn the windmill and make it spin forever. I also want to attach the child at the end of the windmills, and he will rotate with the windmill. Easy solution will be appreciated.
EDIT
I managed to rotate the windmill, I wrote this piece of code:
windmill = [CCSprite spriteWithFile:@"Chorki.png"]; windmill.position = CGPointMake(winSize.width*0.02f, winSize.height*0.56f); windmill.scale = 0.55f; [self addChild:windmill z:0]; CCRotateBy *rot = [CCRepeatForever actionWithAction:[CCRotateBy actionWithDuration:5 angle: 360]]; [windmill runAction:rot];
Now, please help me on how to add a child sprite at the end of each windmill, only 8 bars, and each bar is divided into 45 degrees.
source share