Search code examples
iosanimationcocos2d-iphoneccsprite

Spin CCSprite Cocos2D?


I am trying to spin a CCSprite in Cocos2D but it is hard to explain in words so here is a GIF of the animation I am trying to achieve: http://max.wilsonsd.org:8080/Clip_Art/Pmpa3/symbols/miscellaneous/peace_sign_spinning_hw.gif

Anyway it is a 360 degree spin but not in a clockwise or counter-clockwise way. Anyway how would I achieve this in Cocos2D?

Thanks!


Solution

  • That effect is called flip, try with the CCFlipX/CCFlipX3D actions. For example

    [sprite runAction:[CCRepeatForever actionWithAction:[CCFlipX3D actionWithDuration:1.0]]]
    

    Good luck!