From 9a3a48e429c6aafd3fc469396d12548998e695aa Mon Sep 17 00:00:00 2001 From: nokoe Date: Mon, 1 Jul 2024 19:36:16 +0200 Subject: failure sound --- client/audio/play_random.gd | 4 ++++ client/audio/play_random.tscn | 2 +- client/game.tscn | 1 + client/menu/sounds/failure.ogg | Bin 14740 -> 8296 bytes client/player/effect.gd | 17 +++++++++++------ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/client/audio/play_random.gd b/client/audio/play_random.gd index d702756d..efaad7d8 100644 --- a/client/audio/play_random.gd +++ b/client/audio/play_random.gd @@ -52,6 +52,10 @@ func play_random(): s.pitch_scale = randf_range(0.9, 1.1) s.play() +func stop_all(): + for s in sounds: + s.stop() + func start_autoplay(): autoplay = true play_random() diff --git a/client/audio/play_random.tscn b/client/audio/play_random.tscn index f9b20842..44f3a10b 100644 --- a/client/audio/play_random.tscn +++ b/client/audio/play_random.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=2 format=3 uid="uid://bncx0wul2ikrg"] +[gd_scene load_steps=2 format=3 uid="uid://bbyb6s110my8c"] [ext_resource type="Script" path="res://audio/play_random.gd" id="1_c8pxf"] diff --git a/client/game.tscn b/client/game.tscn index b44974b2..d71ae4be 100644 --- a/client/game.tscn +++ b/client/game.tscn @@ -29,6 +29,7 @@ script = ExtResource("6_fbxu8") [node name="FollowCamera" parent="." node_paths=PackedStringArray("target") instance=ExtResource("2_s8y6o")] transform = Transform3D(0.728777, 0.294253, -0.618303, 0, 0.902961, 0.429723, 0.684751, -0.313173, 0.658057, -2.36537, 1.99403, 3.29507) +current = true far = 150.0 target = NodePath("..") diff --git a/client/menu/sounds/failure.ogg b/client/menu/sounds/failure.ogg index cbe6db14..ef6d6ea4 100644 Binary files a/client/menu/sounds/failure.ogg and b/client/menu/sounds/failure.ogg differ diff --git a/client/player/effect.gd b/client/player/effect.gd index 8371d99d..fedf548f 100644 --- a/client/player/effect.gd +++ b/client/player/effect.gd @@ -1,18 +1,19 @@ # Undercooked - a game about cooking -# Copyright 2024 nokoe, tpart -# +# Copyright 2024 nokoe +# 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 . -# +# class_name Effect extends Node3D @@ -37,4 +38,8 @@ func set_effect(e: String): push_warning("effect %s unknown" % e) func clear_effect(): - $Stars.emitting = false + stars.emitting = false + success.stop() + angry.emitting = false + angry_grunt.stop_all() + failure.stop() -- cgit v1.2.3-70-g09d2