func _input(event):
if event is InputEventScreenDrag and is_pressed():
position += event.realtive
For the connecting part you would have to define a bezier curve, which you tessellate everytime the points of it change. You can then manipulate the points and handles of the curve via script. You can find information about thart part by googling.