aboutsummaryrefslogtreecommitdiff
path: root/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'tutorial')
-rw-r--r--tutorial/coffee_beans.gd3
-rw-r--r--tutorial/devs.gd3
-rw-r--r--tutorial/popup.gd12
-rw-r--r--tutorial/popup.tscn3
-rw-r--r--tutorial/riot.gd3
-rw-r--r--tutorial/riot_aftermath.gd4
-rw-r--r--tutorial/upgrades.gd5
7 files changed, 30 insertions, 3 deletions
diff --git a/tutorial/coffee_beans.gd b/tutorial/coffee_beans.gd
new file mode 100644
index 0000000..d07b984
--- /dev/null
+++ b/tutorial/coffee_beans.gd
@@ -0,0 +1,3 @@
+extends TutorialPopup
+func _trigger():
+ return SaveState.coffee_beans == 0 or (SaveState.bitcoin >= 100 and SaveState.buildings['dev'] > 0)
diff --git a/tutorial/devs.gd b/tutorial/devs.gd
new file mode 100644
index 0000000..d7664a0
--- /dev/null
+++ b/tutorial/devs.gd
@@ -0,0 +1,3 @@
+extends TutorialPopup
+func _trigger():
+ return SaveState.coffee > 5
diff --git a/tutorial/popup.gd b/tutorial/popup.gd
index 1d4c59c..9eaf134 100644
--- a/tutorial/popup.gd
+++ b/tutorial/popup.gd
@@ -2,9 +2,10 @@ extends Label
class_name TutorialPopup
export var identifier = ""
-
+var time_on_screen = 0
+var _mt = false
func _input(event):
- if not is_visible_in_tree():
+ if not is_visible_in_tree() or time_on_screen < 2:
return
if event is InputEventMouseButton:
if event.pressed and event.button_index == BUTTON_LEFT:
@@ -17,9 +18,14 @@ func _trigger() -> bool:
func _ready():
hide() # like the goblin you are
+func manual_trigger():
+ _mt = true
+
func _process(delta):
if SaveState.tutorial[identifier]:
return
- if _trigger():
+ if is_visible_in_tree():
+ time_on_screen += delta
+ if _trigger() or _mt:
show()
get_tree().paused = true
diff --git a/tutorial/popup.tscn b/tutorial/popup.tscn
index aab4ddc..2f615bd 100644
--- a/tutorial/popup.tscn
+++ b/tutorial/popup.tscn
@@ -9,6 +9,9 @@ bg_color = Color( 0.6, 0.933333, 0.847059, 1 )
pause_mode = 2
custom_styles/normal = SubResource( 1 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
+text = "Example text
+"
+align = 1
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
diff --git a/tutorial/riot.gd b/tutorial/riot.gd
new file mode 100644
index 0000000..b000280
--- /dev/null
+++ b/tutorial/riot.gd
@@ -0,0 +1,3 @@
+extends TutorialPopup
+func _trigger():
+ return true
diff --git a/tutorial/riot_aftermath.gd b/tutorial/riot_aftermath.gd
new file mode 100644
index 0000000..f32db8d
--- /dev/null
+++ b/tutorial/riot_aftermath.gd
@@ -0,0 +1,4 @@
+extends TutorialPopup
+
+func _trigger():
+ return SaveState.riot_cooldown > 5
diff --git a/tutorial/upgrades.gd b/tutorial/upgrades.gd
new file mode 100644
index 0000000..05aa588
--- /dev/null
+++ b/tutorial/upgrades.gd
@@ -0,0 +1,5 @@
+extends TutorialPopup
+
+
+func _trigger():
+ return SaveState.buildings['dev'] >= 2