diff options
author | nokoe <nokoe@mailbox.org> | 2024-07-01 14:20:16 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2024-07-01 14:20:16 +0200 |
commit | 9e33622dd28dea70f9d0d6b5e408498214629e89 (patch) | |
tree | d3d0f2fdabe43f904e608439e57457080bed0181 | |
parent | bbb01eecb61d463c289470341c85058717c96408 (diff) | |
parent | c90bf3db5bab1180c3fa651818d18ef1b4792cb3 (diff) | |
download | hurrycurry-9e33622dd28dea70f9d0d6b5e408498214629e89.tar hurrycurry-9e33622dd28dea70f9d0d6b5e408498214629e89.tar.bz2 hurrycurry-9e33622dd28dea70f9d0d6b5e408498214629e89.tar.zst |
Merge branch 'master' of ssh://codeberg.org/metamuffin/undercooked
-rw-r--r-- | client/audio/play_random.gd | 48 | ||||
-rw-r--r-- | client/menu/credits_menu.gd | 8 | ||||
-rw-r--r-- | client/menu/sounds/success.ogg | bin | 26466 -> 10840 bytes | |||
-rw-r--r-- | client/player/character/character.gd | 14 | ||||
-rw-r--r-- | client/player/character/character.tscn | 35 | ||||
-rw-r--r-- | client/player/controllable_player.gd | 11 | ||||
-rw-r--r-- | client/player/sounds/step1.ogg | bin | 0 -> 4037 bytes | |||
-rw-r--r-- | client/player/sounds/step1.ogg.import | 19 | ||||
-rw-r--r-- | client/player/sounds/step2.ogg | bin | 0 -> 3840 bytes | |||
-rw-r--r-- | client/player/sounds/step2.ogg.import | 19 | ||||
-rw-r--r-- | client/player/sounds/step3.ogg | bin | 0 -> 3757 bytes | |||
-rw-r--r-- | client/player/sounds/step3.ogg.import | 19 | ||||
-rw-r--r-- | client/player/sounds/woosh1.ogg | bin | 0 -> 6730 bytes | |||
-rw-r--r-- | client/player/sounds/woosh1.ogg.import | 19 | ||||
-rw-r--r-- | client/player/sounds/woosh2.ogg | bin | 0 -> 6767 bytes | |||
-rw-r--r-- | client/player/sounds/woosh2.ogg.import | 19 |
16 files changed, 197 insertions, 14 deletions
diff --git a/client/audio/play_random.gd b/client/audio/play_random.gd new file mode 100644 index 00000000..afdf046f --- /dev/null +++ b/client/audio/play_random.gd @@ -0,0 +1,48 @@ +# 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 <https://www.gnu.org/licenses/>. +# +extends Node +class_name PlayRandom + +@export var volume_db := 0.0 +@export var enable_attenuations := true + +var autoplay := false + +@onready var sounds = get_children() + +func _ready(): + for s: AudioStreamPlayer3D in sounds: + s.connect("finished", sound_finished) + s.volume_db = volume_db + + if not enable_attenuations: + s.attenuation_filter_cutoff_hz = 20500 + +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..00ca0f04 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,11 @@ 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", + "Woosh Fleuret Escrime B.WAV": "toyoto" } @onready var menu_manager: MenuManager = get_parent() diff --git a/client/menu/sounds/success.ogg b/client/menu/sounds/success.ogg Binary files differindex 590c7dab..37cd2bcd 100644 --- a/client/menu/sounds/success.ogg +++ b/client/menu/sounds/success.ogg diff --git a/client/player/character/character.gd b/client/player/character/character.gd index 36ff1323..11db638f 100644 --- a/client/player/character/character.gd +++ b/client/player/character/character.gd @@ -39,6 +39,9 @@ var current_animation := "idle" "E. Parsley": $Main/Head/Hair3 } +@onready var step_sounds: PlayRandom = $Steps +@onready var boost_sounds: PlayRandom = $Boosts + func _ready(): play_animation("idle") @@ -61,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: @@ -81,6 +88,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..fbfcc1c1 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=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"] @@ -9,6 +9,12 @@ [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://bxiorkb4xb8t1" path="res://player/sounds/step1.ogg" id="10_qpd6x"] +[ext_resource type="AudioStream" uid="uid://l2fd8u7rq3cq" path="res://player/sounds/step2.ogg" id="11_2dmo8"] +[ext_resource type="AudioStream" uid="uid://d353uwy83crca" 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 @@ -558,6 +564,8 @@ tracks/11/keys = { } [sub_resource type="AnimationLibrary" id="AnimationLibrary_xtrfe"] +resource_local_to_scene = false +resource_name = "" _data = { "RESET": SubResource("Animation_tdhvg"), "hold": SubResource("Animation_cvcpd"), @@ -655,4 +663,29 @@ scale_amount_min = 0.5 scale_amount_max = 0.75 scale_amount_curve = SubResource("Curve_7ml8g") +[node name="Steps" type="Node3D" parent="."] +script = ExtResource("14_3rb6x") +volume_db = -12.0 +enable_attenuations = false + +[node name="Step1" type="AudioStreamPlayer3D" parent="Steps"] +stream = ExtResource("10_qpd6x") + +[node name="Step2" type="AudioStreamPlayer3D" parent="Steps"] +stream = ExtResource("11_2dmo8") + +[node name="Step3" type="AudioStreamPlayer3D" parent="Steps"] +stream = ExtResource("12_bj5ue") + +[node name="Boosts" type="Node3D" parent="."] +script = ExtResource("14_3rb6x") +volume_db = -12.0 +enable_attenuations = false + +[node name="Woosh1" type="AudioStreamPlayer3D" parent="Boosts"] +stream = ExtResource("14_ikcec") + +[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/controllable_player.gd b/client/player/controllable_player.gd index e2864290..5c88f19b 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -51,20 +51,13 @@ func _input(_event): chat_bubble.edit() chat_open = !chat_open -func _process(delta): - do_tick() - super(delta) - const MAX_DT = 1./50. -var last_tick = Time.get_ticks_usec() -func do_tick(): - var now = Time.get_ticks_usec() - var delta = (now - last_tick) / 1_000_000. - last_tick = now +func _process(delta): while delta > 0.001: var dt = min(delta, MAX_DT) _process_movement(dt) delta -= dt + super(delta) func _process_movement(delta): var input = Input.get_vector("left", "right", "forward", "backwards") diff --git a/client/player/sounds/step1.ogg b/client/player/sounds/step1.ogg Binary files differnew file mode 100644 index 00000000..563d6444 --- /dev/null +++ b/client/player/sounds/step1.ogg diff --git a/client/player/sounds/step1.ogg.import b/client/player/sounds/step1.ogg.import new file mode 100644 index 00000000..409919f6 --- /dev/null +++ b/client/player/sounds/step1.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bxiorkb4xb8t1" +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 Binary files differnew file mode 100644 index 00000000..a6ec7103 --- /dev/null +++ b/client/player/sounds/step2.ogg diff --git a/client/player/sounds/step2.ogg.import b/client/player/sounds/step2.ogg.import new file mode 100644 index 00000000..2a6f9789 --- /dev/null +++ b/client/player/sounds/step2.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://l2fd8u7rq3cq" +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 Binary files differnew file mode 100644 index 00000000..27dfa368 --- /dev/null +++ b/client/player/sounds/step3.ogg diff --git a/client/player/sounds/step3.ogg.import b/client/player/sounds/step3.ogg.import new file mode 100644 index 00000000..c01a5b7d --- /dev/null +++ b/client/player/sounds/step3.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://d353uwy83crca" +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 diff --git a/client/player/sounds/woosh1.ogg b/client/player/sounds/woosh1.ogg Binary files differnew file mode 100644 index 00000000..284fc480 --- /dev/null +++ b/client/player/sounds/woosh1.ogg 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 Binary files differnew file mode 100644 index 00000000..0a94ec9a --- /dev/null +++ b/client/player/sounds/woosh2.ogg 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 |