Added sounds to titlescreen

This commit is contained in:
2020-04-18 19:30:43 +02:00
parent c461869511
commit f3192c9b30
8 changed files with 74 additions and 10 deletions

View File

@@ -3,10 +3,27 @@ class_name TitleSceenButton
export(String, FILE, "*.tscn,*.scn") var scene_to_load = ""
export(bool) var quit = false
onready var sound_focus = $Sounds/FocusChange
onready var sound_select = $Sounds/OptionSelect
var ignore_once = false
func _pressed():
sound_select.play()
func _on_OptionSelect_finished():
if quit:
get_tree().quit()
return
get_tree().change_scene(scene_to_load)
func _on_TitleScreenButton_mouse_entered():
grab_focus()
func _on_TitleScreenButton_focus_entered():
if not ignore_once:
sound_focus.play()
ignore_once = false