-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.gd
48 lines (40 loc) · 1.13 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
extends Control
@onready var click: AudioStreamPlayer = $AudioStreamPlayer
@onready var clown: Sprite2D = $Clown
@onready var clown_2: AudioStreamPlayer = $Clown/Clown2
@onready var moai: Sprite2D = $Moai
@onready var gojo: Sprite2D = $Gojo
@onready var gojo2: AudioStreamPlayer = $Gojo/Gojo
@onready var moai2: AudioStreamPlayer = $Moai/Moai/Moai2
@onready var gojo_2: Sprite2D = $Gojo2
func _ready():
clown.hide()
moai.hide()
gojo.hide()
gojo_2.hide()
if Global.clown == true:
clown.show()
clown_2.play()
AudioPlayer.stop()
elif Global.moai == true:
moai.show()
moai2.play()
AudioPlayer.stop()
elif Global.gojo == true:
gojo.show()
gojo_2.show()
gojo2.play()
AudioPlayer.stop()
else:
AudioPlayer.play_music_level()
func _on_play_pressed() -> void:
click.play()
get_tree().change_scene_to_file("res://scenes/level_select.tscn")
func _on_options_pressed() -> void:
click.play()
get_tree().change_scene_to_file("res://scenes/options_menu.tscn")
func _on_exit_pressed() -> void:
get_tree().quit()
func _on_leaderboard_pressed() -> void:
click.play()
get_tree().change_scene_to_file("res://scenes/leaderboard.tscn")