diff options
author | Roman Gräf <romangraef@gmail.com> | 2020-04-20 16:02:35 +0200 |
---|---|---|
committer | Roman Gräf <romangraef@gmail.com> | 2020-04-20 16:02:35 +0200 |
commit | c1b75c16eb5132017786134ec61bdf38bf1f6680 (patch) | |
tree | 31c2ea3b0ea6744bf823ed37569aec2b559688cc /tutorial | |
parent | 37e0a74ed171f970937b726fb51d02dbef050949 (diff) | |
download | LDJam46-c1b75c16eb5132017786134ec61bdf38bf1f6680.tar.gz LDJam46-c1b75c16eb5132017786134ec61bdf38bf1f6680.tar.bz2 LDJam46-c1b75c16eb5132017786134ec61bdf38bf1f6680.zip |
tutorial ( at least one tutorial )
Diffstat (limited to 'tutorial')
-rw-r--r-- | tutorial/intro.gd | 4 | ||||
-rw-r--r-- | tutorial/popup.gd | 25 | ||||
-rw-r--r-- | tutorial/popup.tscn | 15 |
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 +} |