aboutsummaryrefslogtreecommitdiff
path: root/tutorial/popup.gd
diff options
context:
space:
mode:
authorRoman Gräf <romangraef@gmail.com>2020-04-20 16:02:35 +0200
committerRoman Gräf <romangraef@gmail.com>2020-04-20 16:02:35 +0200
commitc1b75c16eb5132017786134ec61bdf38bf1f6680 (patch)
tree31c2ea3b0ea6744bf823ed37569aec2b559688cc /tutorial/popup.gd
parent37e0a74ed171f970937b726fb51d02dbef050949 (diff)
downloadLDJam46-c1b75c16eb5132017786134ec61bdf38bf1f6680.tar.gz
LDJam46-c1b75c16eb5132017786134ec61bdf38bf1f6680.tar.bz2
LDJam46-c1b75c16eb5132017786134ec61bdf38bf1f6680.zip
tutorial ( at least one tutorial )
Diffstat (limited to 'tutorial/popup.gd')
-rw-r--r--tutorial/popup.gd25
1 files changed, 25 insertions, 0 deletions
diff --git a/tutorial/popup.gd b/tutorial/popup.gd
new file mode 100644
index 0000000..1d4c59c
--- /dev/null
+++ b/tutorial/popup.gd
@@ -0,0 +1,25 @@
+extends Label
+class_name TutorialPopup
+
+export var identifier = ""
+
+func _input(event):
+ if not is_visible_in_tree():
+ return
+ if event is InputEventMouseButton:
+ if event.pressed and event.button_index == BUTTON_LEFT:
+ SaveState.tutorial[identifier] = true
+ hide()
+ get_tree().paused = false
+
+func _trigger() -> bool:
+ return false
+func _ready():
+ hide() # like the goblin you are
+
+func _process(delta):
+ if SaveState.tutorial[identifier]:
+ return
+ if _trigger():
+ show()
+ get_tree().paused = true