Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wigsOpenAnimation = SKAction.repeatAction(openAtlasAnimation, count: 1)
- wingsFlapAnimation = SKAction.repeatActionForever(flapAtlasAnimation)
- wingsCloseAnimaiton = SKAction.repeatAction(closeAtlasAnimation, count: 1)
- wingsSequence = SKAction.sequence([wingsOpenAnimation,wingsFlapAnimation])
- if (self.onGround == true) || (self.flyMode == false) {
- if String(wings.texture).rangeOfString("Flap8") != nil {
- wings.runAction(SKAction.waitForDuration(wingsFrequency)) {
- self.wings.removeActionForKey("wingsSequence")
- self.wings.runAction(self.wingsCloseAnimaiton)
- }
- }
- }
- Sprite.run(SKAction.repeatForever(SKAction.animate(with: Sprite1TextureArray, timePerFrame: 0.15)))
- DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(900) /**Amount of frames * timePerFrame*/, execute: {
- //Your second animation
- self.Sprite.run(SKAction.repeatForever(SKAction.animate(with: self.Sprite2TextureArray, timePerFrame: 0.15)))
- })
Add Comment
Please, Sign In to add comment