2018-09-10

game

2018-09-10_第1张图片
func randomInRange(_ range: ClosedRange) -> Int {     let count = UInt32(range.upperBound - range.lowerBound)     return  Int(arc4random_uniform(count)) + range.lowerBound } extension UIColor {     class func UIColorFromRGB(_ rgbValue: UInt) -> UIColor {         return UIColor(             red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,             green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,             blue: CGFloat(rgbValue & 0x0000FF) / 255.0,             alpha: CGFloat(1.0)         )     } } extension SKAction {     class func moveDistance(_ distance:CGVector, fadeInWithDuration duration:TimeInterval) -> SKAction {         let fadeIn = SKAction.fadeIn(withDuration: duration)         let moveIn = SKAction.move(by: distance, duration: duration)         return SKAction.group([fadeIn, moveIn])     }          class func moveDistance(_ distance:CGVector, fadeOutWithDuration duration:TimeInterval) -> SKAction {         let fadeOut = SKAction.fadeOut(withDuration: duration)         let moveOut = SKAction.move(by: distance, duration: duration)         return SKAction.group([fadeOut, moveOut])     } }
2018-09-10_第2张图片

你可能感兴趣的:(2018-09-10)