BWSnippet

SpriteKit SKAction Scale with wait, completion, and key

SpriteKit SKAction Scale with wait, completion, and key

Want to do scaling, with run block, wait, and re-scale using a key using spritekit?

                let scale = SKAction.scale(to: 0.5 , duration: 0.5 )
                let wait = SKAction.wait(forDuration: 0.5)
                let runBlock = SKAction.run {
                    //now scale back to norm size? or do something else
                    print(" HELLO ! RUN BLOCK AREA ")
                    let scaleBackToNorm = SKAction.scale(to: 1.0 , duration: 0.5 )
                    self.run( scaleBackToNorm )
                }
                let seq = SKAction.sequence( [ scale , wait , runBlock ] )
                self.run( seq , withKey: "scale_me_please")

Tags

SpriteKit SKAction Scale with wait, completion, and key