diff options
author | altaf-creator <dev@altafcreator.com> | 2024-04-15 06:48:35 +0700 |
---|---|---|
committer | altaf-creator <dev@altafcreator.com> | 2024-04-15 06:48:35 +0700 |
commit | a0c5063fbc0f7f4f1205a58f764995243d800184 (patch) | |
tree | 595dd136155fb3fb2fee3b251b6dcbc91dbb3469 /Scripts/Tutorial.gd | |
parent | e730e2188eda08bf84fea7335dc2c0f3b5551509 (diff) |
sfx, tutorial, polish
Diffstat (limited to 'Scripts/Tutorial.gd')
-rw-r--r-- | Scripts/Tutorial.gd | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Scripts/Tutorial.gd b/Scripts/Tutorial.gd new file mode 100644 index 0000000..91236eb --- /dev/null +++ b/Scripts/Tutorial.gd @@ -0,0 +1,31 @@ +extends Node +class_name Tutorial +## OH NO 1 HOUR LEFT + +@export var step_controls : Array[Control] +@export var current_step : int = 0 + +var tutorial_started = false + +func _ready(): + if !GlobalVariables.tutorial_played: + start_tutorial() + +func _input(_event): + if Input.is_action_just_pressed("space") && tutorial_started: + next_step() + +func start_tutorial(): + tutorial_started = true + step_controls[0].visible = true + current_step = 0 + +func next_step(): + if current_step + 1 < step_controls.size(): + step_controls[current_step].visible = false + step_controls[current_step + 1].visible = true + current_step += 1 + else: + step_controls[current_step].visible = false + tutorial_started = false + GlobalVariables.tutorial_played = true |