summaryrefslogtreecommitdiff
path: root/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd
diff options
context:
space:
mode:
authorjacob janzen <53062115+JacobJanzen@users.noreply.github.com>2024-11-16 14:16:06 -0600
committerGitHub <noreply@github.com>2024-11-16 14:16:06 -0600
commitaacf95aab9f2bec6c9f8676960122bcfa440bb9f (patch)
tree3e9cfeb768765bf14cce2dbdfa07d78adefadac4 /scenes/LegallyDistinctPaperclipAssistant/paperclip.gd
parent606c1714c654cb247a70c23b335a0aeca91c4c52 (diff)
add clippy (#3)
Diffstat (limited to 'scenes/LegallyDistinctPaperclipAssistant/paperclip.gd')
-rw-r--r--scenes/LegallyDistinctPaperclipAssistant/paperclip.gd51
1 files changed, 51 insertions, 0 deletions
diff --git a/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd b/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd
new file mode 100644
index 0000000..d431372
--- /dev/null
+++ b/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd
@@ -0,0 +1,51 @@
+extends Window
+
+const START_TEXT = "Hi, I'm your legally\ndistinct paperclip\nassistant,\nClippette..."
+const TOUCHED = "Don't touch me!"
+
+var angy: Sprite2D
+var normal: Sprite2D
+var hapi: Sprite2D
+var label: Label
+var timer: Timer
+var panel: Panel
+
+var current_text = START_TEXT
+
+# Called when the node enters the scene tree for the first time.
+func _ready() -> void:
+ angy = $Angy
+ hapi = $Hapi
+ normal = $Normal
+ label = $Label
+ timer = $Timer
+ panel = $Panel
+
+ normal.visible = true;
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(_delta: float) -> void:
+ if current_text == "":
+ label.visible = false
+ panel.visible = false
+ else:
+ label.text = "" # I hate this, but it does fix a bug
+ label.text = current_text
+ label.visible = true
+ panel.visible = true
+
+
+func _on_texture_button_button_up() -> void:
+ normal.visible = false
+ hapi.visible = false
+ angy.visible = true
+ current_text = TOUCHED
+ timer.start()
+
+func _on_timer_timeout() -> void:
+ normal.visible = true
+ hapi.visible = false
+ angy.visible = false
+ current_text = ""
+ timer.stop()