des bruits de pas

tralala
This commit is contained in:
Thomas
2025-03-31 17:24:16 +02:00
parent b091bb96db
commit 6517dd744e
16 changed files with 102 additions and 39 deletions

View File

@@ -29,7 +29,10 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
$AudioStreamPlayer2D.pitch_scale = current_speed / speed
var pitch = current_speed / speed
if is_zero_approx(pitch):
pitch = 0.01
$AudioStreamPlayer2D.pitch_scale = pitch
$ZIndexControler/ShapeCast2D.enabled = !$CollisionHorizontal.disabled
var accelerationStep = (speed * delta / timeToChangeVelocity)