Cocos2D help: How to rotate a sprite continuously and generate child sprites in the rotating sprite

后端 未结 2 2052
伪装坚强ぢ
伪装坚强ぢ 2021-02-10 23:28

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

2条回答
  •  时光取名叫无心
    2021-02-11 00:18

    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]];

提交回复
热议问题