I have SKLabelNode representing current score, which I'm trying to animate with growing and shrinking sequence, whenever score value hits some particular number(e.g. 10, 20, ...). Problem is that animation itself has some sort of delay inbetween and takes far more time than duration I've set. Basically it grows, then it waits and after while finally shrinks back.
Here's my code:
override func didMoveToView(view: SKView) {
/* Setup your scene here */
...
//skactions setting
growAction = SKAction.scaleBy(1.2, duration: 0.4)
shrinkAction = SKAction.scaleBy(0.8333, duration: 0.4)
growAndShrink = SKAction.sequence([growAction, shrinkAction])
...
}
override func update(currentTime: CFTimeInterval) {
/* Called before each frame is rendered */
if (score % 10) == 0 && score != 0 && gameState == GameState.Play {
scoreLabel.runAction(growAndShrink)
}
}
I though update func is the right one to use for that, or is it?