summaryrefslogtreecommitdiff
path: root/Scenes/Entities/Objects/Sign.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Scenes/Entities/Objects/Sign.gd')
-rw-r--r--Scenes/Entities/Objects/Sign.gd20
1 files changed, 20 insertions, 0 deletions
diff --git a/Scenes/Entities/Objects/Sign.gd b/Scenes/Entities/Objects/Sign.gd
new file mode 100644
index 0000000..9d83bab
--- /dev/null
+++ b/Scenes/Entities/Objects/Sign.gd
@@ -0,0 +1,20 @@
+extends StaticBody2D
+
+
+signal interacted
+
+var interaction_area: Area2D
+
+
+func _ready():
+ add_to_group("interactables")
+
+ interaction_area = Utilities.Collision.Area.new(self, $CollisionShape2D)
+ add_child(interaction_area)
+
+
+func _physics_process(_delta):
+ if Input.is_action_just_pressed("ui_accept") and interaction_area.has_overlapping_areas():
+ for area in interaction_area.get_overlapping_areas():
+ if area.is_in_group("player"):
+ emit_signal("interacted")