diff --git a/godot_ship/script/game/Gameplay.gd b/godot_ship/script/game/Gameplay.gd index 5c3808e..52ecf92 100644 --- a/godot_ship/script/game/Gameplay.gd +++ b/godot_ship/script/game/Gameplay.gd @@ -17,4 +17,5 @@ func _ready(): func _on_Forfeit_pressed(): queue_free(); + AudioBus.emit_signal("button_clicked") MessageBus.emit_signal("change_scene", "Title") diff --git a/godot_ship/script/game/moveShip.gd b/godot_ship/script/game/moveShip.gd index b7bb2dd..58b6a6f 100644 --- a/godot_ship/script/game/moveShip.gd +++ b/godot_ship/script/game/moveShip.gd @@ -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 @@ -194,12 +196,14 @@ func _input(event): # pass func pickup(): + #AudioBus.emit_signal("button_clicked") if held: return mode = RigidBody2D.MODE_STATIC held = true func drop(impulse=Vector2.ZERO): + #AudioBus.emit_signal("button_clicked") if held: mode = RigidBody2D.MODE_RIGID apply_central_impulse(impulse) diff --git a/godot_ship/script/title screen/Title Screen.gd b/godot_ship/script/title screen/Title Screen.gd index e1e92ea..af2512d 100644 --- a/godot_ship/script/title screen/Title Screen.gd +++ b/godot_ship/script/title screen/Title Screen.gd @@ -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()