From 516d22c1737a9c94026b5ff0c9856bc5549aa416 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 3 May 2024 09:32:22 +0200 Subject: update --- Scenes/Entities/Objects/Button.gd | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Scenes/Entities/Objects/Button.gd (limited to 'Scenes/Entities/Objects/Button.gd') 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") -- cgit v1.2.3