 }
 
 class CountdownNode: SKLabelNode {
-    private var coundownStartTimeInterval: CFTimeInterval?
+    private static let growAndFadeActions =
+        SKAction.group([SKAction.scaleTo(2, duration: 1),
+                        SKAction.fadeAlphaTo(0.4, duration: 1)])
+    private static let resetGrowAndFadeActions =
+        SKAction.group([SKAction.scaleTo(1, duration: 0),
+                        SKAction.fadeAlphaTo(1, duration: 0)])
+    
     weak var delegate: CountdownDelegate?
     
     private var timer: NSTimer?

    override init() {
        super.init()
        text = "\(countdownTimerStart)"
        fontName = "HelveticaNeue-Bold"
        fontSize *= 3
        fontColor = UIColor.blackColor()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
//    func updateCountdownTime(currentTime: CFTimeInterval) {
//        if let start = coundownStartTimeInterval {
//            let timeSinceStart = Int(currentTime - start)
//            let countdownValue = countdownTimerStart - timeSinceStart
//            if countdownValue > 0 {
//                text = "\(countdownValue)"
//            } else {
//                removeFromParent()
//                delegate?.didCountdownEnd()
//            }
//        } else {
//            coundownStartTimeInterval = currentTime
//        }
//    }
    
    func start() {
        timer?.invalidate()

                        selector: #selector(CountdownNode.timerAction),
                        userInfo: nil, repeats: false)
        NSRunLoop.mainRunLoop().addTimer(timer!, forMode: NSRunLoopCommonModes)
        runAction(CountdownNode.growAndFadeActions)
    }
    
    func timerAction() {
        countdownValue -= 1
        if countdownValue <= 0 {
            reset()
            delegate?.didCountdownEnd()
        } else {
            text = "\(countdownValue)"
            runAction(CountdownNode.resetGrowAndFadeActions)
            runAction(CountdownNode.growAndFadeActions)
            start()
        }
    }
    
    func reset() {
        timer?.invalidate()
        removeFromParent()
        countdownValue = countdownTimerStart
        text = "\(countdownTimerStart)"
        runAction(CountdownNode.resetGrowAndFadeActions)
    }
}