Reputation: 997
I have my sprite rotating, but a little too fast, here is my code, any idea how to control the speed of the rotation?
//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:)];
Upvotes: 0
Views: 402
Reputation: 69027
You can try to make it slower by increasing its duration:
id rotate = [CCRotateBy actionWithDuration:X angle:360];
where you can use, e.g., 5.0 for X. This will make it 5 times slower as it currently is.
Upvotes: 1