pitch sound change added

This commit is contained in:
John-vince 2025-05-23 18:15:25 +02:00
parent 43b070dc93
commit 93d545a84d

View File

@ -2,6 +2,7 @@ extends ProgressBar
var addAmount: float
@onready var Player = get_node("audioJungle");
var rng = RandomNumberGenerator.new()
func _ready() -> void:
await get_tree().process_frame
@ -17,8 +18,10 @@ func collect():
print("Collected crystal")
value += addAmount
if value != 100.0:
Player.pitch_scale = rng.randf_range(0.5, 2.0)
Player.stream = load("res://collectables/crystal/sounds/Picked Coin Echo.wav")
else:
Player.pitch_scale = 1.0;
Player.stream = load("res://collectables/crystal/sounds/Picked Coin Echo 2.wav")
Player.play();