diff --git a/godot_ship/.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.md5 b/godot_ship/.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.md5 new file mode 100644 index 0000000..9d059f1 --- /dev/null +++ b/godot_ship/.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.md5 @@ -0,0 +1,3 @@ +source_md5="b8fcdd3fcd8e6af7810b21a25fbbfce8" +dest_md5="2a8113abc3da9686cb5813edf48afc5b" + diff --git a/godot_ship/.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.oggstr b/godot_ship/.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.oggstr new file mode 100644 index 0000000..65aa47b Binary files /dev/null and b/godot_ship/.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.oggstr differ diff --git a/godot_ship/.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.md5 b/godot_ship/.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.md5 new file mode 100644 index 0000000..ee0b67b --- /dev/null +++ b/godot_ship/.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.md5 @@ -0,0 +1,3 @@ +source_md5="f3327d109e31f66117e71347bf5d23a6" +dest_md5="aeb44b0dd8e5c6c535635c258781f974" + diff --git a/godot_ship/.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.oggstr b/godot_ship/.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.oggstr new file mode 100644 index 0000000..6914a21 Binary files /dev/null and b/godot_ship/.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.oggstr differ diff --git a/godot_ship/BGM - Captain Scurvy.ogg b/godot_ship/BGM - Captain Scurvy.ogg new file mode 100644 index 0000000..a81a3c1 Binary files /dev/null and b/godot_ship/BGM - Captain Scurvy.ogg differ diff --git a/godot_ship/BGM - Captain Scurvy.ogg.import b/godot_ship/BGM - Captain Scurvy.ogg.import new file mode 100644 index 0000000..f95cf60 --- /dev/null +++ b/godot_ship/BGM - Captain Scurvy.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.oggstr" + +[deps] + +source_file="res://BGM - Captain Scurvy.ogg" +dest_files=[ "res://.import/BGM - Captain Scurvy.ogg-324577f882a12f61687c746f4a4197ad.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/godot_ship/ButtonSFX.ogg b/godot_ship/ButtonSFX.ogg new file mode 100644 index 0000000..7155a0c Binary files /dev/null and b/godot_ship/ButtonSFX.ogg differ diff --git a/godot_ship/ButtonSFX.ogg.import b/godot_ship/ButtonSFX.ogg.import new file mode 100644 index 0000000..29e78fb --- /dev/null +++ b/godot_ship/ButtonSFX.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.oggstr" + +[deps] + +source_file="res://ButtonSFX.ogg" +dest_files=[ "res://.import/ButtonSFX.ogg-8c2b86050b91df563dcd88f6eb352c80.oggstr" ] + +[params] + +loop=false +loop_offset=0 diff --git a/godot_ship/project.godot b/godot_ship/project.godot index e18a4ad..36867c8 100644 --- a/godot_ship/project.godot +++ b/godot_ship/project.godot @@ -18,6 +18,7 @@ config/icon="res://icon.png" MessageBus="*res://script/game/Message Bus.gd" OptionsController="*res://script/options/OptionsController.gd" +AudioController="*res://scenes/AudioController.tscn" [display] diff --git a/godot_ship/scenes/AudioController.tscn b/godot_ship/scenes/AudioController.tscn new file mode 100644 index 0000000..2f790fd --- /dev/null +++ b/godot_ship/scenes/AudioController.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://BGM - Captain Scurvy.ogg" type="AudioStream" id=1] +[ext_resource path="res://script/audio controller/AudioController.gd" type="Script" id=2] + +[node name="Control" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="BGM" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 1 ) +autoplay = true diff --git a/godot_ship/scenes/Options.tscn b/godot_ship/scenes/Options.tscn index af9e8fa..841e34e 100644 --- a/godot_ship/scenes/Options.tscn +++ b/godot_ship/scenes/Options.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://script/options/Option-Background.png" type="Texture" id=1] [ext_resource path="res://script/options/Options.gd" type="Script" id=2] +[ext_resource path="res://ButtonSFX.ogg" type="AudioStream" id=3] [node name="Options" type="Control"] anchor_right = 1.0 @@ -153,6 +154,9 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="ButtonSFX" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 3 ) + [connection signal="value_changed" from="Sliders/SFX Setting/SFX Slider" to="." method="_on_SFX_Slider_value_changed"] [connection signal="value_changed" from="Sliders/Volume Setting/Volume Slider" to="." method="_on_Volume_Slider_value_changed"] [connection signal="pressed" from="Buttons/Light" to="." method="_on_Light_pressed"] diff --git a/godot_ship/scenes/Title Screen.tscn b/godot_ship/scenes/Title Screen.tscn index a309212..e6fee5e 100644 --- a/godot_ship/scenes/Title Screen.tscn +++ b/godot_ship/scenes/Title Screen.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://script/title screen/Title-Screen-Background.png" type="Texture" id=1] [ext_resource path="res://script/title screen/Title Screen.gd" type="Script" id=2] +[ext_resource path="res://ButtonSFX.ogg" type="AudioStream" id=3] [node name="Title Node" type="Control"] anchor_right = 1.0 @@ -15,6 +16,9 @@ __meta__ = { position = Vector2( 320, 180 ) texture = ExtResource( 1 ) +[node name="ButtonSFX" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 3 ) + [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.5 anchor_top = 0.5 diff --git a/godot_ship/script/audio controller/AudioController.gd b/godot_ship/script/audio controller/AudioController.gd new file mode 100644 index 0000000..4301c20 --- /dev/null +++ b/godot_ship/script/audio controller/AudioController.gd @@ -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 diff --git a/godot_ship/script/options/Options.gd b/godot_ship/script/options/Options.gd index 6f8ea4b..44cf018 100644 --- a/godot_ship/script/options/Options.gd +++ b/godot_ship/script/options/Options.gd @@ -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() diff --git a/godot_ship/script/title screen/Title Screen.gd b/godot_ship/script/title screen/Title Screen.gd index e1e92ea..b1a2682 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(): + $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()