-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.gd
51 lines (32 loc) · 1.11 KB
/
menu.gd
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 TextureRect
onready var mainMenu = get_node("CenterContainer/mainMenu")
onready var settingsMenu = get_node("CenterContainer/settingsMenu")
onready var levelMenu = get_node("CenterContainer/levelMenu")
onready var creditsMenu = get_node("CenterContainer/creditsMenu")
onready var creditsButton = get_node("creditsContainer")
func _on_settingsButton_pressed():
MusicController.play_sound("click")
mainMenu.hide()
settingsMenu.show()
func _on_backButton_pressed():
MusicController.play_sound("click")
settingsMenu.hide()
levelMenu.hide()
mainMenu.show()
func _on_playButton_down():
MusicController.play_sound("click")
mainMenu.hide()
levelMenu.show()
func _playLevel(levelName):
MusicController.play_sound("click")
get_tree().change_scene("res://" + levelName + ".tscn")
func _on_creditsButton_pressed():
MusicController.play_sound("click")
creditsButton.visible = false
levelMenu.visible = false
creditsMenu.visible = true
func _on_backCreditsButton_pressed():
MusicController.play_sound("click")
creditsMenu.visible = false
levelMenu.visible = true
creditsButton.visible = true