1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2025-02-04 12:28:35 +00:00

Added BGM and Button SFX sounds

This commit is contained in:
hpham474
2021-11-01 04:26:17 -05:00
parent e4a92faaea
commit 1b3333203e
15 changed files with 90 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
extends Control
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@@ -13,21 +13,28 @@ func _ready():
music_slider.value = OptionsController.get_mus_volume()
func _on_Button_pressed():
$ButtonSFX.play()
queue_free()
# MessageBus.emit_signal("change_scene", "Title")
func _on_SFX_Slider_value_changed(value):
OptionsController.set_sfx_vol(value)
OptionsController.save_options()
if !$ButtonSFX.is_playing():
$ButtonSFX.play()
func _on_Volume_Slider_value_changed(value):
OptionsController.set_mus_vol(value)
OptionsController.save_options()
if !$ButtonSFX.is_playing():
$ButtonSFX.play()
func _on_Light_pressed():
OptionsController.set_theme("light")
OptionsController.save_options()
$ButtonSFX.play()
func _on_Dark_pressed():
OptionsController.set_theme("dark")
OptionsController.save_options()
$ButtonSFX.play()

View File

@@ -5,17 +5,21 @@ func _ready():
$VBoxContainer/Singleplayer.grab_focus()
func _on_Singleplayer_pressed():
$ButtonSFX.play()
MessageBus.emit_signal("change_scene", "Singleplayer")
queue_free()
func _on_Multiplayer_pressed():
$ButtonSFX.play()
MessageBus.emit_signal("change_scene", "Multiplayer")
queue_free()
func _on_Options_pressed():
$ButtonSFX.play()
MessageBus.emit_signal("change_scene", "Options")
queue_free()
func _on_Quit_pressed():
$ButtonSFX.play()
MessageBus.emit_signal("quit")
queue_free()