extends Node2D

var Rope = preload("res://src/Contraptions/Rope/Rope.tscn") 
var start_pos := Vector2.ZERO
var end_pos := Vector2.ZERO
onready var rope: Node2D = null

func _ready() -> void:
	pass
	# rope = Rope.instance()
	# add_child(rope)
	# rope.rope_start = get_node("BoundFrog/RopeAnchor")
	# rope.rope_end = get_node("BoundFrog/WhatAreFrog")
	# rope.rope_start_joint = get_node("BoundFrog/RopeAnchor/cshape/pjoint")
	# rope.rope_end_joint = get_node("BoundFrog/WhatAreFrog/cshape/pjoint")
	# rope.spawn_rope($BoundFrog/RopeAnchor.global_position, $BoundFrog.global_position, false)

# func _input(event):
# 	if event is InputEventMouseButton && !event.is_pressed():
# 		if start_pos == Vector2.ZERO:
# 			start_pos = get_global_mouse_position()
# 		elif end_pos == Vector2.ZERO:
# 			end_pos = get_global_mouse_position()
# 			rope = Rope.instance()
# 			add_child(rope)
# 			rope.spawn_rope(start_pos, end_pos)
# 			start_pos = Vector2.ZERO
# 			end_pos = Vector2.ZERO
	# if rope != null && event.is_action_pressed("click"):
	# 	rope.mouse_follow = true
	# if event.is_action_released("click"):
	# 	if rope != null:
	# 		rope.mouse_follow = false

