diff --git a/assets/sfx/LICENSES b/assets/sfx/LICENSES new file mode 100644 index 0000000..1630014 --- /dev/null +++ b/assets/sfx/LICENSES @@ -0,0 +1,2 @@ +land.wav - https://opengameart.org/content/3-item-sounds - CC-BY 3.0 +coinsplash.ogg - https://opengameart.org/content/coin-splash - No Rights Reserved diff --git a/assets/sfx/coinsplash.ogg b/assets/sfx/coinsplash.ogg new file mode 100644 index 0000000..6566a7b Binary files /dev/null and b/assets/sfx/coinsplash.ogg differ diff --git a/assets/sfx/coinsplash.ogg.import b/assets/sfx/coinsplash.ogg.import new file mode 100644 index 0000000..f02b912 --- /dev/null +++ b/assets/sfx/coinsplash.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dkxv7wbq8s1gs" +path="res://.godot/imported/coinsplash.ogg-f4cc7a136a244c66d0c3ed8863b3a3e6.oggvorbisstr" + +[deps] + +source_file="res://assets/sfx/coinsplash.ogg" +dest_files=["res://.godot/imported/coinsplash.ogg-f4cc7a136a244c66d0c3ed8863b3a3e6.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sfx/land.wav b/assets/sfx/land.wav new file mode 100644 index 0000000..ffde2a8 Binary files /dev/null and b/assets/sfx/land.wav differ diff --git a/assets/sfx/land.wav.import b/assets/sfx/land.wav.import new file mode 100644 index 0000000..022cbbd --- /dev/null +++ b/assets/sfx/land.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dy3ngeohp1uqf" +path="res://.godot/imported/land.wav-6f339f0cb8abb44d119c317df4f4b636.sample" + +[deps] + +source_file="res://assets/sfx/land.wav" +dest_files=["res://.godot/imported/land.wav-6f339f0cb8abb44d119c317df4f4b636.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/default_bus_layout.tres b/default_bus_layout.tres index d9e8fb3..8a4ad60 100644 --- a/default_bus_layout.tres +++ b/default_bus_layout.tres @@ -1,7 +1,6 @@ [gd_resource type="AudioBusLayout" format=3 uid="uid://dcxpomrfumov"] [resource] -bus/0/mute = true bus/1/name = &"Music" bus/1/solo = false bus/1/mute = false diff --git a/src/ingame/bomb.gd b/src/ingame/bomb.gd index a491c24..1045f22 100644 --- a/src/ingame/bomb.gd +++ b/src/ingame/bomb.gd @@ -1,7 +1,9 @@ class_name Bomb extends Node3D +# TODO: have those in item db instead ? @export var _splash_small_sound: AudioStreamPlayer3D @export var _splash_small_quiet_sound: AudioStreamPlayer3D +@export var _sell_sound: AudioStreamPlayer3D @export var _model: Node3D @export var _splash_particles: GPUParticles3D @export var _picking_area: Area3D @@ -11,8 +13,9 @@ class_name Bomb extends Node3D ## Initials to construct from @export var item_id := &"ID" @export var item_count := 0 + ## Will be constructed as { item_id, item_count }, but could be edited after -## Use init_with_bundle() if it's dynamically assigned +## Use set_item_bundle() if it's dynamically assigned, after adding to the scene @export var item_bundle: Dictionary ## Effect of splhashing. @@ -81,6 +84,12 @@ func _on_body_entered(p_body: Node3D) -> void: var item := GameState.fetch().INVENTORY_ITEM_DB[item_bundle["item_id"]] as InventoryItem if item.sells_for != 0: get_node("/root/Main").add_inventory_item.rpc(&"coin", item.sells_for * item_bundle["count"]) + if _sell_sound != null: + _sell_sound.play() + is_dead = true + _model.hide() + _disable_body.rpc() + await _sell_sound.finished queue_free() return @@ -88,7 +97,7 @@ func _on_body_entered(p_body: Node3D) -> void: for area: Area3D in _in_splash_range: area.get_parent_node_3d().water.rpc_id(1, sender_id) - if _splash_small_sound != null: + if _splash_small_sound != null and sender_id != 0: _splash_small_sound.play() if _splash_small_quiet_sound: _splash_small_quiet_sound.play() @@ -98,10 +107,12 @@ func _on_body_entered(p_body: Node3D) -> void: is_dead = true _model.hide() _disable_body.rpc() - if _splash_small_sound != null: + + if _splash_small_sound != null and sender_id != 0: await _splash_small_sound.finished if _splash_small_quiet_sound != null and _splash_small_quiet_sound.playing: await _splash_small_quiet_sound.finished + queue_free() diff --git a/src/ingame/item_bomb.tscn b/src/ingame/item_bomb.tscn index 4fb7b9c..dcd68ae 100644 --- a/src/ingame/item_bomb.tscn +++ b/src/ingame/item_bomb.tscn @@ -1,7 +1,9 @@ -[gd_scene load_steps=9 format=3 uid="uid://bpvbnlhpth4w7"] +[gd_scene load_steps=11 format=3 uid="uid://bpvbnlhpth4w7"] [ext_resource type="Script" path="res://src/ingame/bomb.gd" id="1_27lur"] [ext_resource type="PackedScene" uid="uid://dxb5f3il2h1ur" path="res://src/ingame/quad_viewmodel.tscn" id="2_fy6j6"] +[ext_resource type="AudioStream" uid="uid://dy3ngeohp1uqf" path="res://assets/sfx/land.wav" id="3_1vo65"] +[ext_resource type="AudioStream" uid="uid://dkxv7wbq8s1gs" path="res://assets/sfx/coinsplash.ogg" id="4_fyu6c"] [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_0ebrr"] properties/0/path = NodePath(".:position") @@ -41,8 +43,10 @@ radius = 0.2 [sub_resource type="SphereShape3D" id="SphereShape3D_y6453"] radius = 1.5 -[node name="ItemBomb" type="Node3D" node_paths=PackedStringArray("_model", "_picking_area", "body")] +[node name="ItemBomb" type="Node3D" node_paths=PackedStringArray("_splash_small_sound", "_sell_sound", "_model", "_picking_area", "body")] script = ExtResource("1_27lur") +_splash_small_sound = NodePath("DropSound") +_sell_sound = NodePath("SellSound") _model = NodePath("Model") _picking_area = NodePath("PickingArea") body = NodePath("RigidBody3D") @@ -93,6 +97,16 @@ monitoring = false [node name="CollisionShape3D" type="CollisionShape3D" parent="PickingArea"] shape = SubResource("SphereShape3D_6c830") +[node name="DropSound" type="AudioStreamPlayer3D" parent="."] +stream = ExtResource("3_1vo65") +volume_db = 10.0 +bus = &"SoundEffects" + +[node name="SellSound" type="AudioStreamPlayer3D" parent="."] +stream = ExtResource("4_fyu6c") +volume_db = 2.0 +bus = &"SoundEffects" + [connection signal="body_entered" from="RigidBody3D" to="." method="_on_body_entered"] [connection signal="area_entered" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_entered"] [connection signal="area_exited" from="RigidBody3D/SplashArea" to="." method="_on_splash_area_exited"] diff --git a/src/ingame/pipe.tscn b/src/ingame/pipe.tscn index 701059e..13fcd49 100644 --- a/src/ingame/pipe.tscn +++ b/src/ingame/pipe.tscn @@ -27,7 +27,7 @@ mesh = SubResource("PlaneMesh_g3bb5") [node name="ProjectileHolder" type="Node" parent="."] [node name="DropTimer" type="Timer" parent="."] -wait_time = 2.0 +wait_time = 2.5 autostart = true [connection signal="timeout" from="DropTimer" to="." method="_on_drop_timer_timeout"]