diff --git a/behaviours/draggable.gd b/behaviours/draggable.gd new file mode 100644 index 0000000..28c4b1b --- /dev/null +++ b/behaviours/draggable.gd @@ -0,0 +1,19 @@ +extends Node +class_name Draggable + + +signal dragged +signal dropped + + +var being_dragged: bool = false + + +func drag(): + being_dragged = true + dragged.emit() + + +func drop(): + being_dragged = false + dropped.emit() diff --git a/behaviours/draggable.tscn b/behaviours/draggable.tscn new file mode 100644 index 0000000..81be1f5 --- /dev/null +++ b/behaviours/draggable.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://dijcjahkddudv"] + +[ext_resource type="Script" path="res://behaviours/draggable.gd" id="1_hdedq"] + +[node name="Draggable" type="Node"] +script = ExtResource("1_hdedq") diff --git a/behaviours/pickable.gd b/behaviours/pickable.gd deleted file mode 100644 index 9f6f232..0000000 --- a/behaviours/pickable.gd +++ /dev/null @@ -1,2 +0,0 @@ -extends Node -class_name Pickable diff --git a/behaviours/pickable.tscn b/behaviours/pickable.tscn deleted file mode 100644 index be4ff48..0000000 --- a/behaviours/pickable.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://dijcjahkddudv"] - -[ext_resource type="Script" path="res://behaviours/pickable.gd" id="1_ymn8e"] - -[node name="Pickable" type="Node"] -script = ExtResource("1_ymn8e")