Attenuation / pause of the sprite kit

I am trying to implement a pause function for my game. So far I have succeeded by setting the sprite speed to "0". But the sprites on which I applied attenuation behave strangely when the pause button is pressed (speed = 0); Their translation. Both location and rotation go to another time / place in action when the speed is set to “0” and also when they are from reset to “1”. I would really appreciate some material on this issue: either a fix for my code, or a better way to do this :)

My sprite moving code is:

SKAction* _movePlayerUp = [SKAction moveToY:200 duration:3];
movePlayerUp.timingMode = SKActionTimingEaseOut;
[_playerSprite runAction: movePlayerUp];

Pause function:

  _playerSprite.speed = 0;

Pause Off Function:

  _playerSprite.speed = 1;

Thank you in advance!

Regards, Espen

+4
1

LearnCocos2D ( Setffen Itterheim ?), , _playerSprite paused YES. , - paused SKView, SKScene. speed SKAction , .

+2

All Articles