diff --git a/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.md5 b/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.md5 index dd2febb..dc35f36 100644 --- a/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.md5 +++ b/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.md5 @@ -1,3 +1,3 @@ source_md5="aa361943427692c39cd21430895a1f89" -dest_md5="a384b01bb3a48f53f019cb11e44e2019" +dest_md5="71290af628a880e44134b3636fc49535" diff --git a/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.oggstr b/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.oggstr index 0d5b279..5261971 100644 Binary files a/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.oggstr and b/godot_ship/.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.oggstr differ diff --git a/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.md5 b/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.md5 index 93ca95d..90af281 100644 --- a/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.md5 +++ b/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.md5 @@ -1,3 +1,3 @@ source_md5="4121e74ab010d628490c26ed5391a8f1" -dest_md5="e6145a1ff71559de29a79fa4b0b0fee2" +dest_md5="8556f1ced20c3b073ae4fcb8a300e349" diff --git a/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.oggstr b/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.oggstr index e3ddb9a..dbb57d5 100644 Binary files a/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.oggstr and b/godot_ship/.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.oggstr differ diff --git a/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.md5 b/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.md5 index 6f77432..aa69243 100644 --- a/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.md5 +++ b/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.md5 @@ -1,3 +1,3 @@ source_md5="d71fa2832e0ad78e94bbd353bc53c2bf" -dest_md5="87d33fdc866cbaaee42f97113a36ceac" +dest_md5="e694209bc2af13019893f9a931b65aae" diff --git a/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.oggstr b/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.oggstr index f3bc471..c10859e 100644 Binary files a/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.oggstr and b/godot_ship/.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.oggstr differ diff --git a/godot_ship/assets/audio/HitSFX.ogg.import b/godot_ship/assets/audio/HitSFX.ogg.import index f39b0c1..7f85105 100644 --- a/godot_ship/assets/audio/HitSFX.ogg.import +++ b/godot_ship/assets/audio/HitSFX.ogg.import @@ -11,5 +11,5 @@ dest_files=[ "res://.import/HitSFX.ogg-93a1e93085ac0a2fc2e723f5d44a2ca9.oggstr" [params] -loop=true +loop=false loop_offset=0 diff --git a/godot_ship/assets/audio/MissSFX.ogg.import b/godot_ship/assets/audio/MissSFX.ogg.import index 5689c33..8767d4e 100644 --- a/godot_ship/assets/audio/MissSFX.ogg.import +++ b/godot_ship/assets/audio/MissSFX.ogg.import @@ -11,5 +11,5 @@ dest_files=[ "res://.import/MissSFX.ogg-d7b93821aa1c2b607fa4dc4bb3561322.oggstr" [params] -loop=true +loop=false loop_offset=0 diff --git a/godot_ship/assets/audio/SunkSFX.ogg.import b/godot_ship/assets/audio/SunkSFX.ogg.import index df8f7c6..17cd2ab 100644 --- a/godot_ship/assets/audio/SunkSFX.ogg.import +++ b/godot_ship/assets/audio/SunkSFX.ogg.import @@ -11,5 +11,5 @@ dest_files=[ "res://.import/SunkSFX.ogg-52b6d419298328defecfc61b6c15659d.oggstr" [params] -loop=true +loop=false loop_offset=0 diff --git a/godot_ship/scenes/AudioController.tscn b/godot_ship/scenes/AudioController.tscn index 5de3d12..c4112e2 100644 --- a/godot_ship/scenes/AudioController.tscn +++ b/godot_ship/scenes/AudioController.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://assets/audio/BGM - Captain Scurvy.ogg" type="AudioStream" id=1] [ext_resource path="res://script/audio controller/AudioController.gd" type="Script" id=2] [ext_resource path="res://assets/audio/ButtonSFX.ogg" type="AudioStream" id=3] +[ext_resource path="res://assets/audio/HitSFX.ogg" type="AudioStream" id=4] +[ext_resource path="res://assets/audio/MissSFX.ogg" type="AudioStream" id=5] +[ext_resource path="res://assets/audio/SunkSFX.ogg" type="AudioStream" id=6] [node name="Control" type="Control"] anchor_right = 1.0 @@ -20,3 +23,15 @@ bus = "BGM" [node name="buttonSFX" type="AudioStreamPlayer" parent="."] stream = ExtResource( 3 ) bus = "SFX" + +[node name="shipHitSFX" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 4 ) +bus = "SFX" + +[node name="shipMissedSFX" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 5 ) +bus = "SFX" + +[node name="shipSunkSFX" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 6 ) +bus = "SFX" diff --git a/godot_ship/script/audio controller/Audio Bus.gd b/godot_ship/script/audio controller/Audio Bus.gd index 4fbe1d1..dac0314 100644 --- a/godot_ship/script/audio controller/Audio Bus.gd +++ b/godot_ship/script/audio controller/Audio Bus.gd @@ -6,3 +6,6 @@ extends Node # Ask for a scene change signal button_clicked +signal ship_hit +signal ship_missed +signal ship_sunk diff --git a/godot_ship/script/audio controller/AudioController.gd b/godot_ship/script/audio controller/AudioController.gd index a128649..193e0a6 100644 --- a/godot_ship/script/audio controller/AudioController.gd +++ b/godot_ship/script/audio controller/AudioController.gd @@ -9,9 +9,22 @@ extends Control func _ready(): var _errno = 0 _errno += AudioBus.connect("button_clicked", self, "_button_clicked") + _errno += AudioBus.connect("ship_hit", self, "_ship_hit") + _errno += AudioBus.connect("ship_missed", self, "_ship_missed") + _errno += AudioBus.connect("ship_sunk", self, "_ship_sunk") func _button_clicked(): $buttonSFX.play() + +func _ship_hit(): + $shipHitSFX.play() + +func _ship_missed(): + $shipMissedSFX.play() + +func _ship_sunk(): + $shipSunkSFX.play() + # Called every frame. 'delta' is the elapsed time since the previous frame. #func _process(delta): # pass