From a0c5063fbc0f7f4f1205a58f764995243d800184 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Mon, 15 Apr 2024 06:48:35 +0700 Subject: sfx, tutorial, polish --- Scripts/Tutorial.gd | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Scripts/Tutorial.gd (limited to 'Scripts/Tutorial.gd') 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 -- cgit v1.2.3