From 5e10556537c79911b1a660c992e3a8081510c68d Mon Sep 17 00:00:00 2001 From: tpart Date: Mon, 1 Jul 2024 20:22:26 +0200 Subject: Add default put and take sounds --- client/audio/play_random.gd | 2 ++ client/audio/play_random.tscn | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'client/audio') diff --git a/client/audio/play_random.gd b/client/audio/play_random.gd index efaad7d8..df77de2f 100644 --- a/client/audio/play_random.gd +++ b/client/audio/play_random.gd @@ -48,6 +48,8 @@ func configure_player(player): player.attenuation_filter_cutoff_hz = 20500 func play_random(): + if sounds.size() == 0: return + var s = sounds[randi_range(0, sounds.size() - 1)] s.pitch_scale = randf_range(0.9, 1.1) s.play() diff --git a/client/audio/play_random.tscn b/client/audio/play_random.tscn index 44f3a10b..f9b20842 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://bbyb6s110my8c"] +[gd_scene load_steps=2 format=3 uid="uid://bncx0wul2ikrg"] [ext_resource type="Script" path="res://audio/play_random.gd" id="1_c8pxf"] -- cgit v1.2.3-70-g09d2