diff options
Diffstat (limited to 'Scenes/Entities/Objects/Button.gd')
-rw-r--r-- | Scenes/Entities/Objects/Button.gd | 13 |
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") |