1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2024-11-14 21:15:58 +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,3 @@
source_md5="b8fcdd3fcd8e6af7810b21a25fbbfce8"
dest_md5="2a8113abc3da9686cb5813edf48afc5b"

View File

@ -0,0 +1,3 @@
source_md5="f3327d109e31f66117e71347bf5d23a6"
dest_md5="aeb44b0dd8e5c6c535635c258781f974"

Binary file not shown.

View File

@ -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

BIN
godot_ship/ButtonSFX.ogg Normal file

Binary file not shown.

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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"]

View File

@ -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

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()