减慢cocos2d的旋转速度

时间:2012-10-03 09:47:48

标签: iphone objective-c xcode cocos2d-iphone

我的精灵旋转,但有点太快,这是我的代码,任何想法如何控制旋转的速度?

//enemySprite
    enemySprite = [CCSprite spriteWithFile:@"Asteroid.png"];
    enemySprite.anchorPoint = ccp(0.5f, 0.5f);
    enemySprite.position = ccp(arc4random()%480, winSize.height -60);

//Rotation
    id rotate = [CCRotateBy actionWithDuration:1 angle:360];
    id repeatRotate = [CCRepeatForever actionWithAction:rotate];
    [enemySprite runAction:repeatRotate];

    [self addChild:enemySprite z:5];
    [self schedule:@selector(callEveryFrame:)];

1 个答案:

答案 0 :(得分:1)

您可以尝试通过增加持续时间来降低速度:

id rotate = [CCRotateBy actionWithDuration:X angle:360];

你可以使用例如5.0的X.这将使它比现在慢5倍。