aboutsummaryrefslogtreecommitdiff
path: root/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'tutorial')
-rw-r--r--tutorial/intro.gd4
-rw-r--r--tutorial/popup.gd25
-rw-r--r--tutorial/popup.tscn15
3 files changed, 44 insertions, 0 deletions
diff --git a/tutorial/intro.gd b/tutorial/intro.gd
new file mode 100644
index 0000000..3de468b
--- /dev/null
+++ b/tutorial/intro.gd
@@ -0,0 +1,4 @@
+extends TutorialPopup
+
+func _trigger():
+ return true
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
diff --git a/tutorial/popup.tscn b/tutorial/popup.tscn
new file mode 100644
index 0000000..aab4ddc
--- /dev/null
+++ b/tutorial/popup.tscn
@@ -0,0 +1,15 @@
+[gd_scene load_steps=3 format=2]
+
+[ext_resource path="res://tutorial/popup.gd" type="Script" id=1]
+
+[sub_resource type="StyleBoxFlat" id=1]
+bg_color = Color( 0.6, 0.933333, 0.847059, 1 )
+
+[node name="Node2D" type="Label"]
+pause_mode = 2
+custom_styles/normal = SubResource( 1 )
+custom_colors/font_color = Color( 0, 0, 0, 1 )
+script = ExtResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}