嗨朋友我正在实现 cocos2d 游戏。因为我想在给定半径内旋转具有特定距离的 ccsprite。我正在实施这个。我想顺时针旋转精灵,然后逆时针旋转一段时间。对此有何改变。
self.isAccelerometerEnabled = NO;
TimerFlag = 0;
float AngleTick = 0.1;
currentAngle -= AngleTick;
circleCenter.x = 280;
circleCenter.y = 160;
newTankFish.position = ccpAdd(ccpMult(ccpForAngle(currentAngle), 120), circleCenter);
newTankFish.rotation = currentAngle * -180 / M_PI;
id tankFishMove = [CCRepeat actionWithDuration:3.0];
id TankPowerDone = [CCCallFunc actionWithTarget:self selector:@selector(TankPowerOver)];
[newTankFish runAction:[CCSequence actions:tankFishMove, TankPowerDone, nil]];
[CoinProjectiles addObject:newTankFish];