         
     }
     
-    //MARK - Touch
+    //MARK: Frame life cycle
+    override func update(_ currentTime: TimeInterval) {
+        // Called before each frame is rendered
+    }
+    override func didEvaluateActions() {
+        // code
+    }
+    override func didSimulatePhysics() {
+        if didShoot {
+            shoot()
+            didShoot = false
+        }
+        // Clean up balls
+        mainLayer?.enumerateChildNodes(withName: "ball", using: { (node, stop) in
+            if  !self.frame.contains(node.position) {
+                node.removeFromParent()
+            }
+        })
+    }
+    
+    override func didApplyConstraints() {
+        //<#code#>
+    }
+    override func didFinishUpdate() {
+        //<#code#>
+    }
+    
+    
+    //MARK: - Touch handling
     
     func touchDown(atPoint pos : CGPoint) {
 //        if let n = self.spinnyNode?.copy() as! SKShapeNode? {

//        if let label = self.label {
//            label.run(SKAction.init(named: "Pulse")!, withKey: "fadeInOut")
//        }
        shoot()
        for t in touches { self.touchDown(atPoint: t.location(in: self)) }
    }
    

    }
    
    
}
