 			if cappedPosition != textureNodePosition {
 				textureNode.position = rootNode.convert(worldPosition: cappedPosition)
 			}
+			lineNode.points[1] = textureNode.position
 		}
-//		lineNode.points[1] = textureNode.position
 	}
 	
 	override func touchBegan(atPosition position: CGPoint) {
-		if let node = self.node(atPosition: position), node.parent != nil {
+		if let node = self.node(atPosition: position) as? TextureNode, node.parent != nil {
 			node.cancelAnimations()
 			selectedChildNode = node
 		}

	}
	
	var moveDirection = CGPoint(x: 1, y: 1)
	override func update(withContext context:RenderContext) {
		if !useAnimations {
			textureNode.rotation += 0.02
			

		rootNode.scale = CGSize(width: 10, height: 10)
		addChild(rootNode)
		
		let textureNode = TextureNode(name: "pim", size:CGSize(width:2, height:2))
		textureNode.position = CGPoint(x: 0, y: 0)
		self.textureNode = textureNode
		rootNode.addChild(textureNode)
		
		lineNode = LineNode()
		lineNode.colors = [.yellow, .purple]
