summaryrefslogtreecommitdiff
path: root/Scripts/Tutorial.gd
blob: 91236eb8f3f1ca62a4787a260375c6e78d971546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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