Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. func flipTile(node : RectSprite){
  2.  
  3. let flip = SKAction.scaleXTo(-1, duration: 0.4)
  4.  
  5. node.setScale(1.0)
  6.  
  7. var changeColor = SKAction.runBlock( { node.texture = SKTexture(imageNamed: "blue")})
  8. var action = SKAction.sequence([flip, changeColor] )
  9.  
  10. node.runAction(action)
  11.  
  12. }
  13.  
  14. func flipCard (node: SKNode, label: SKLabelNode)
  15. {
  16. label.isHidden = true
  17.  
  18. node.run(SKAction.sequence(
  19. [SKAction.scaleX(to: 0, duration: 0.2),
  20. SKAction.scale(to: 1, duration: 0.0),
  21. SKAction.setTexture(SKTexture(imageNamed: "Redcard-blank")),
  22. SKAction.fadeOut(withDuration: 2),
  23. SKAction.fadeIn(withDuration: 2),
  24. SKAction.fadeOut(withDuration: 2),
  25. ]
  26. ))
  27. label.isHidden = false
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement