diff options
author | tpart <tpart120@proton.me> | 2024-07-01 20:22:26 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-07-01 20:26:07 +0200 |
commit | 5e10556537c79911b1a660c992e3a8081510c68d (patch) | |
tree | 34f54c67c7bb66f1af201b97e810f6c507e44e96 /client/audio | |
parent | dbd0b769af6267426496b18bd788b8a68165c667 (diff) | |
download | hurrycurry-5e10556537c79911b1a660c992e3a8081510c68d.tar hurrycurry-5e10556537c79911b1a660c992e3a8081510c68d.tar.bz2 hurrycurry-5e10556537c79911b1a660c992e3a8081510c68d.tar.zst |
Add default put and take sounds
Diffstat (limited to 'client/audio')
-rw-r--r-- | client/audio/play_random.gd | 2 | ||||
-rw-r--r-- | client/audio/play_random.tscn | 2 |
2 files changed, 3 insertions, 1 deletions
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"] |