aboutsummaryrefslogtreecommitdiff
path: root/client/player/character/character.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/player/character/character.gd')
-rw-r--r--client/player/character/character.gd14
1 files changed, 13 insertions, 1 deletions
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)