diff options
Diffstat (limited to 'client/player/character')
-rw-r--r-- | client/player/character/character.gd | 7 | ||||
-rw-r--r-- | client/player/character/character.tscn | 21 |
2 files changed, 27 insertions, 1 deletions
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"] |