我的精灵旋转,但有点太快,这是我的代码,任何想法如何控制旋转的速度?
//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:)];
答案 0 :(得分:1)
您可以尝试通过增加持续时间来降低速度:
id rotate = [CCRotateBy actionWithDuration:X angle:360];
你可以使用例如5.0的X.这将使它比现在慢5倍。