         return node
     }
     
-    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
-        if let touch = touches.first {
-            touchPoint = touch.location(in: self)
-        }
-    }
-    
     override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
         if let touch = touches.first {
-            
+            let location = touch.location(in: self)
+            let previous = touch.previousLocation(in: self)
+            
+            var x = location.x - previous.x
+            var y = location.y - previous.y
+            let b = sqrt(pow(location.x, 2) + pow(location.y, 2))
+            x = b == 0 ? 0 : (x / b)
+            y = b == 0 ? 0 : (y / b)
+            
+            if x == 0 && y == 0 {
+                return
+            }
+            
+            moving = true
+            
+            for node in children {
+                let pushStrength: CGFloat = 1000
+                
+//                let w = node.frame.width / 2
+//                let h = node.frame.height / 2
+                
+                var direction = CGVector(
+                    dx: pushStrength * x,
+                    dy: pushStrength * y
+                )
+                
+                node.physicsBody?.applyForce(direction)
+            }
         }
     }
     
     override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
-        if !moving, let point = touchPoint, let node = atPoint(point) as? Node {
+        if !moving, let point = touches.first?.location(in: self), let node = atPoint(point) as? Node {
             node.selected = !node.selected
         }
         moving = false

        super.addChild(node)
    }
    
    var touchPoint: CGPoint?
    var moving: Bool = false
    
    override func atPoint(_ p: CGPoint) -> SKNode {

        var actions = [SKAction]()
        if selected {
            sprite.texture = SKTexture(imageNamed: image)
            actions.append(SKAction.scale(to: 1.3, duration: 0.2))
        } else {
            sprite.texture = nil
            actions.append(SKAction.scale(to: 1, duration: 0.2))
        }
        run(SKAction.group(actions))
    }
    
}
