1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2024-11-15 05:25:57 +00:00

Bugfix: audio now plays when changing scenes; added audio to ships being interacted

This commit is contained in:
hpham474 2021-11-07 20:53:08 -06:00
parent 4eb6a6cad4
commit 16dee66c2e
3 changed files with 8 additions and 1 deletions

View File

@ -16,5 +16,6 @@ func _ready():
func _on_Forfeit_pressed():
AudioBus.emit_signal("button_clicked")
queue_free();
MessageBus.emit_signal("change_scene", "Title")

View File

@ -21,6 +21,7 @@ func _input(event):
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
if (event.position - position).length() < click_radius:
if not held and event.pressed:
AudioBus.emit_signal("button_clicked")
held = true;
if held and not event.pressed:
@ -106,6 +107,7 @@ func _input(event):
if checkOriginalPos():
return
else:
AudioBus.emit_signal("button_clicked")
if originalPos == null:
if position == originalPos:
return

View File

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