summaryrefslogtreecommitdiff
path: root/scenes/menu.gd
blob: 30537445205d41fa57ca5ab646768d369bc93947 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
extends Node2D


func _ready():
	_difficulty_text()
	_fullscreen_text()


func _on_Exit_on_click():
	get_tree().quit()


func _on_Strart_on_click():
	if not $Outgoing.is_playing():
		$Outgoing.play("tointro")


func _on_Outgoing_animation_finished(anim_name):
	if anim_name == "tointro":
		get_tree().change_scene("res://scenes/introduction/come home.tscn")


func _on_Back_on_click():
	$success_sound.play(0.5)
	$Outgoing.play_backwards("tosettings")

func _difficulty_text():
	if Settings.difficulty == Settings.Difficulty.HARD:
		$Content/CustomLabel.text = "Hard"
	else:
		$Content/CustomLabel.text = "Easy"

func _on_HardMode_on_click():
	Settings.difficulty = 1 - Settings.difficulty
	_difficulty_text()
	Settings.save()

func _on_SettingsButton_on_click():
	$success_sound.play()
	$Outgoing.play("tosettings")


func _on_Fullscreen_on_click():
	OS.set_window_fullscreen(!OS.window_fullscreen)
	_fullscreen_text()
	
func _fullscreen_text():
	if OS.window_fullscreen:
		$Content/FullscreenLabel.text = "ON"
	else:
		$Content/FullscreenLabel.text = "OFF"