CCRotateBy和CCRotate无法正确使用ARM64设备

时间:2017-01-28 15:41:17

标签: ios cocos2d-iphone cocos2d-x ccrotateby

   const float gravity = 9.8f;

    float L = 0.01f;

    double CurrentTime = CACurrentMediaTime();

    double angle = 40.0f * sin(sqrt((gravity/L)*CurrentTime));

    id rotation = [CCRotateTo actionWithDuration:3.0 angle:angle];
    id reverseRotation = [CCRotateTo actionWithDuration:3.0 angle:sprhang.rotation];
    [sprhang runAction:[CCRepeatForever actionWithAction:[CCSequence actions:rotation, reverseRotation , nil]]];
  // [sprhang runAction:[CCRepeatForever actionWithAction:[CCSequence actions:rotation,reverseRotation], nil]]];
     [self addChild:sprhang];

这是我的代码,用于显示sprite的钟摆效果,它适用于非ARM64的旧设备,顺便说一下,我在CCRotationBY和CCRotationTO的CCAnmation Interval类中进行了一些代码更改,以支持ARM64设备。它工作正常..但我的问题是,当我把上面的代码,第一个动作旋转工作正常,但反向动作显示突然运动回到以前的位置然后再次良好的第一次旋转和当反向运动的时间它显示突然运动朝着初始位置,我希望任何人都会帮助我。

0 个答案:

没有答案