summaryrefslogtreecommitdiff
path: root/Scenes/Entities/Objects/Button.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-05-03 09:32:22 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-05-03 09:32:22 +0200
commit516d22c1737a9c94026b5ff0c9856bc5549aa416 (patch)
treecd9ef3089d1c8bdfc440b5673f7ad0d0dce787a9 /Scenes/Entities/Objects/Button.gd
parentd192b1546ab39180cdc28d2621c117539e3d26d6 (diff)
update
Diffstat (limited to 'Scenes/Entities/Objects/Button.gd')
-rw-r--r--Scenes/Entities/Objects/Button.gd13
1 files changed, 13 insertions, 0 deletions
diff --git a/Scenes/Entities/Objects/Button.gd b/Scenes/Entities/Objects/Button.gd
new file mode 100644
index 0000000..f028440
--- /dev/null
+++ b/Scenes/Entities/Objects/Button.gd
@@ -0,0 +1,13 @@
+extends Area2D
+
+
+signal pressed
+
+var is_pressed: bool = false
+
+
+func _on_body_entered(body):
+ if body is Player and not is_pressed:
+ is_pressed = true
+ $AnimatedSprite2D.play("pressed")
+ emit_signal("pressed")