From 7851ca0883ea06308bef485d53fd7cbe4fc62dce Mon Sep 17 00:00:00 2001 From: tpart Date: Mon, 1 Jul 2024 13:04:12 +0200 Subject: Re-encode success sound to decrease file size --- client/menu/sounds/success.ogg | Bin 26466 -> 10840 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'client/menu') diff --git a/client/menu/sounds/success.ogg b/client/menu/sounds/success.ogg index 590c7dab..37cd2bcd 100644 Binary files a/client/menu/sounds/success.ogg and b/client/menu/sounds/success.ogg differ -- cgit v1.2.3-70-g09d2 From 533a52b11a0e89b2646f9d507432c92d4f552e78 Mon Sep 17 00:00:00 2001 From: tpart Date: Mon, 1 Jul 2024 13:28:07 +0200 Subject: Add footstep sounds to character --- client/audio/play_random.gd | 41 +++++++++++++++++++++++++++++++++ client/menu/credits_menu.gd | 7 +++--- client/player/character/character.gd | 7 ++++++ client/player/character/character.tscn | 21 ++++++++++++++++- client/player/sounds/step1.ogg | Bin 0 -> 4852 bytes client/player/sounds/step1.ogg.import | 19 +++++++++++++++ client/player/sounds/step2.ogg | Bin 0 -> 4713 bytes client/player/sounds/step2.ogg.import | 19 +++++++++++++++ client/player/sounds/step3.ogg | Bin 0 -> 4624 bytes client/player/sounds/step3.ogg.import | 19 +++++++++++++++ 10 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 client/audio/play_random.gd create mode 100644 client/player/sounds/step1.ogg create mode 100644 client/player/sounds/step1.ogg.import create mode 100644 client/player/sounds/step2.ogg create mode 100644 client/player/sounds/step2.ogg.import create mode 100644 client/player/sounds/step3.ogg create mode 100644 client/player/sounds/step3.ogg.import (limited to 'client/menu') diff --git a/client/audio/play_random.gd b/client/audio/play_random.gd new file mode 100644 index 00000000..1efced30 --- /dev/null +++ b/client/audio/play_random.gd @@ -0,0 +1,41 @@ +# Undercooked - a game about cooking +# Copyright 2024 tpart +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +extends Node +class_name PlayRandom + +@onready var sounds = get_children() + +var autoplay := false + +func _ready(): + for s in sounds: + s.connect("finished", sound_finished) + +func play_random(): + var s = sounds[randi_range(0, sounds.size() - 1)] + s.pitch_scale = randf_range(0.9, 1.1) + s.play() + +func start_autoplay(): + autoplay = true + play_random() + +func stop_autoplay(): + autoplay = false + +func sound_finished(): + if autoplay: + play_random() diff --git a/client/menu/credits_menu.gd b/client/menu/credits_menu.gd index 59e7bab9..86a4443f 100644 --- a/client/menu/credits_menu.gd +++ b/client/menu/credits_menu.gd @@ -1,5 +1,5 @@ # Undercooked - a game about cooking -# Copyright 2024 metamuffin +# Copyright 2024 metamuffin, tpart # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -21,9 +21,10 @@ var cc_by_3 := { "Glasses": "Jeremy Edelblut" } var cc_by_4 := { - "Universal UI/Menu Soundpack": "Ellr", + "Footstep sounds": "Dryoma", + "Page_Turn_24.wav": "Koops", "Pencil, Writing, Close, A.wav": "InspectorJ", - "Page_Turn_24.wav": "Koops" + "Universal UI/Menu Soundpack": "Ellr" } @onready var menu_manager: MenuManager = get_parent() diff --git a/client/player/character/character.gd b/client/player/character/character.gd index 36ff1323..385481cc 100644 --- a/client/player/character/character.gd +++ b/client/player/character/character.gd @@ -39,6 +39,8 @@ var current_animation := "idle" "E. Parsley": $Main/Head/Hair3 } +@onready var step_sounds: PlayRandom = $Steps + func _ready(): play_animation("idle") @@ -81,6 +83,11 @@ func select_hairstyle(id: int): func play_animation(name_: String): current_animation = name_ hand_animations.play(name_) + + if name_ == "walk": + step_sounds.start_autoplay() + else: + step_sounds.stop_autoplay() func _on_hand_animations_animation_finished(_name): hand_animations.play(current_animation) diff --git a/client/player/character/character.tscn b/client/player/character/character.tscn index e4a2af66..eb090b02 100644 --- a/client/player/character/character.tscn +++ b/client/player/character/character.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=18 format=3 uid="uid://b3hhir2fvnunu"] +[gd_scene load_steps=22 format=3 uid="uid://b3hhir2fvnunu"] [ext_resource type="Script" path="res://player/character/character.gd" id="1_12lbh"] [ext_resource type="ArrayMesh" uid="uid://bnmm01yjwultj" path="res://player/character/main.res" id="2_lxdbd"] @@ -9,6 +9,10 @@ [ext_resource type="ArrayMesh" uid="uid://dx7jswwaesok4" path="res://player/character/hair_2.res" id="7_0551e"] [ext_resource type="ArrayMesh" uid="uid://c2qnwt44x8ujl" path="res://player/character/tie.res" id="7_knv6q"] [ext_resource type="ArrayMesh" uid="uid://c5qsthvtf3cta" path="res://player/character/hair_3.res" id="8_2bc5u"] +[ext_resource type="AudioStream" uid="uid://b5qwlhus7serr" path="res://player/sounds/step1.ogg" id="10_qpd6x"] +[ext_resource type="AudioStream" uid="uid://4b6ix4pkfxpj" path="res://player/sounds/step2.ogg" id="11_2dmo8"] +[ext_resource type="AudioStream" uid="uid://ywlunfulmrc6" path="res://player/sounds/step3.ogg" id="12_bj5ue"] +[ext_resource type="Script" path="res://audio/play_random.gd" id="14_3rb6x"] [sub_resource type="Animation" id="Animation_tdhvg"] length = 0.001 @@ -655,4 +659,19 @@ scale_amount_min = 0.5 scale_amount_max = 0.75 scale_amount_curve = SubResource("Curve_7ml8g") +[node name="Steps" type="Node" parent="."] +script = ExtResource("14_3rb6x") + +[node name="Step1" type="AudioStreamPlayer" parent="Steps"] +stream = ExtResource("10_qpd6x") +volume_db = -16.0 + +[node name="Step2" type="AudioStreamPlayer" parent="Steps"] +stream = ExtResource("11_2dmo8") +volume_db = -16.0 + +[node name="Step3" type="AudioStreamPlayer" parent="Steps"] +stream = ExtResource("12_bj5ue") +volume_db = -16.0 + [connection signal="animation_finished" from="HandAnimations" to="." method="_on_hand_animations_animation_finished"] diff --git a/client/player/sounds/step1.ogg b/client/player/sounds/step1.ogg new file mode 100644 index 00000000..fee63a29 Binary files /dev/null and b/client/player/sounds/step1.ogg differ diff --git a/client/player/sounds/step1.ogg.import b/client/player/sounds/step1.ogg.import new file mode 100644 index 00000000..d992834c --- /dev/null +++ b/client/player/sounds/step1.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://b5qwlhus7serr" +path="res://.godot/imported/step1.ogg-fb18c712af8c20437bc3716795beb323.oggvorbisstr" + +[deps] + +source_file="res://player/sounds/step1.ogg" +dest_files=["res://.godot/imported/step1.ogg-fb18c712af8c20437bc3716795beb323.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/client/player/sounds/step2.ogg b/client/player/sounds/step2.ogg new file mode 100644 index 00000000..f043a70c Binary files /dev/null and b/client/player/sounds/step2.ogg differ diff --git a/client/player/sounds/step2.ogg.import b/client/player/sounds/step2.ogg.import new file mode 100644 index 00000000..0cc05416 --- /dev/null +++ b/client/player/sounds/step2.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://4b6ix4pkfxpj" +path="res://.godot/imported/step2.ogg-cac7b3cbd2fc698c0ac3ca59fb818e5d.oggvorbisstr" + +[deps] + +source_file="res://player/sounds/step2.ogg" +dest_files=["res://.godot/imported/step2.ogg-cac7b3cbd2fc698c0ac3ca59fb818e5d.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/client/player/sounds/step3.ogg b/client/player/sounds/step3.ogg new file mode 100644 index 00000000..7f2f9955 Binary files /dev/null and b/client/player/sounds/step3.ogg differ diff --git a/client/player/sounds/step3.ogg.import b/client/player/sounds/step3.ogg.import new file mode 100644 index 00000000..82db7301 --- /dev/null +++ b/client/player/sounds/step3.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://ywlunfulmrc6" +path="res://.godot/imported/step3.ogg-2d825d8675e6dad3253d34dfcabf3b0e.oggvorbisstr" + +[deps] + +source_file="res://player/sounds/step3.ogg" +dest_files=["res://.godot/imported/step3.ogg-2d825d8675e6dad3253d34dfcabf3b0e.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 -- cgit v1.2.3-70-g09d2 From a79507334a51ec53414a31b61d0398e1ef1e71c6 Mon Sep 17 00:00:00 2001 From: tpart Date: Mon, 1 Jul 2024 13:56:45 +0200 Subject: Add boost sound effects --- client/menu/credits_menu.gd | 3 ++- client/player/character/character.gd | 7 ++++++- client/player/character/character.tscn | 14 +++++++++++++- client/player/sounds/woosh1.ogg | Bin 0 -> 6730 bytes client/player/sounds/woosh1.ogg.import | 19 +++++++++++++++++++ client/player/sounds/woosh2.ogg | Bin 0 -> 6767 bytes client/player/sounds/woosh2.ogg.import | 19 +++++++++++++++++++ 7 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 client/player/sounds/woosh1.ogg create mode 100644 client/player/sounds/woosh1.ogg.import create mode 100644 client/player/sounds/woosh2.ogg create mode 100644 client/player/sounds/woosh2.ogg.import (limited to 'client/menu') diff --git a/client/menu/credits_menu.gd b/client/menu/credits_menu.gd index 86a4443f..00ca0f04 100644 --- a/client/menu/credits_menu.gd +++ b/client/menu/credits_menu.gd @@ -24,7 +24,8 @@ var cc_by_4 := { "Footstep sounds": "Dryoma", "Page_Turn_24.wav": "Koops", "Pencil, Writing, Close, A.wav": "InspectorJ", - "Universal UI/Menu Soundpack": "Ellr" + "Universal UI/Menu Soundpack": "Ellr", + "Woosh Fleuret Escrime B.WAV": "toyoto" } @onready var menu_manager: MenuManager = get_parent() diff --git a/client/player/character/character.gd b/client/player/character/character.gd index 385481cc..11db638f 100644 --- a/client/player/character/character.gd +++ b/client/player/character/character.gd @@ -40,6 +40,7 @@ var current_animation := "idle" } @onready var step_sounds: PlayRandom = $Steps +@onready var boost_sounds: PlayRandom = $Boosts func _ready(): play_animation("idle") @@ -63,7 +64,11 @@ func _process(delta): next_animation = "idle" walking_particles.emitting = walking - boosting_particles.emitting = boosting and walking and not was_boosting + if boosting and walking and not was_boosting: + boosting_particles.emitting = true + boost_sounds.play_random() + else: + boosting_particles.emitting = false was_boosting = boosting and walking if current_animation != next_animation: diff --git a/client/player/character/character.tscn b/client/player/character/character.tscn index 106b4057..3bea6100 100644 --- a/client/player/character/character.tscn +++ b/client/player/character/character.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=22 format=3 uid="uid://b3hhir2fvnunu"] +[gd_scene load_steps=24 format=3 uid="uid://b3hhir2fvnunu"] [ext_resource type="Script" path="res://player/character/character.gd" id="1_12lbh"] [ext_resource type="ArrayMesh" uid="uid://bnmm01yjwultj" path="res://player/character/main.res" id="2_lxdbd"] @@ -13,6 +13,8 @@ [ext_resource type="AudioStream" uid="uid://4b6ix4pkfxpj" path="res://player/sounds/step2.ogg" id="11_2dmo8"] [ext_resource type="AudioStream" uid="uid://ywlunfulmrc6" path="res://player/sounds/step3.ogg" id="12_bj5ue"] [ext_resource type="Script" path="res://audio/play_random.gd" id="14_3rb6x"] +[ext_resource type="AudioStream" uid="uid://1jsqpnk3igj3" path="res://player/sounds/woosh1.ogg" id="14_ikcec"] +[ext_resource type="AudioStream" uid="uid://cwme7eatip0jc" path="res://player/sounds/woosh2.ogg" id="15_iv4wu"] [sub_resource type="Animation" id="Animation_tdhvg"] length = 0.001 @@ -674,4 +676,14 @@ volume_db = -8.0 stream = ExtResource("12_bj5ue") volume_db = -8.0 +[node name="Boosts" type="Node" parent="."] +script = ExtResource("14_3rb6x") + +[node name="Woosh1" type="AudioStreamPlayer3D" parent="Boosts"] +stream = ExtResource("14_ikcec") +volume_db = -8.0 + +[node name="Woosh2" type="AudioStreamPlayer3D" parent="Boosts"] +stream = ExtResource("15_iv4wu") + [connection signal="animation_finished" from="HandAnimations" to="." method="_on_hand_animations_animation_finished"] diff --git a/client/player/sounds/woosh1.ogg b/client/player/sounds/woosh1.ogg new file mode 100644 index 00000000..284fc480 Binary files /dev/null and b/client/player/sounds/woosh1.ogg differ diff --git a/client/player/sounds/woosh1.ogg.import b/client/player/sounds/woosh1.ogg.import new file mode 100644 index 00000000..38b1c435 --- /dev/null +++ b/client/player/sounds/woosh1.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://1jsqpnk3igj3" +path="res://.godot/imported/woosh1.ogg-1f4b2fe1be72c87cf944d6c0761e71c8.oggvorbisstr" + +[deps] + +source_file="res://player/sounds/woosh1.ogg" +dest_files=["res://.godot/imported/woosh1.ogg-1f4b2fe1be72c87cf944d6c0761e71c8.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/client/player/sounds/woosh2.ogg b/client/player/sounds/woosh2.ogg new file mode 100644 index 00000000..0a94ec9a Binary files /dev/null and b/client/player/sounds/woosh2.ogg differ diff --git a/client/player/sounds/woosh2.ogg.import b/client/player/sounds/woosh2.ogg.import new file mode 100644 index 00000000..c38bf1fe --- /dev/null +++ b/client/player/sounds/woosh2.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://cwme7eatip0jc" +path="res://.godot/imported/woosh2.ogg-adc164c3f2035f82c8c508e981753d03.oggvorbisstr" + +[deps] + +source_file="res://player/sounds/woosh2.ogg" +dest_files=["res://.godot/imported/woosh2.ogg-adc164c3f2035f82c8c508e981753d03.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 -- cgit v1.2.3-70-g09d2