pitch sound change added
This commit is contained in:
parent
43b070dc93
commit
93d545a84d
|
@ -2,6 +2,7 @@ extends ProgressBar
|
||||||
|
|
||||||
var addAmount: float
|
var addAmount: float
|
||||||
@onready var Player = get_node("audioJungle");
|
@onready var Player = get_node("audioJungle");
|
||||||
|
var rng = RandomNumberGenerator.new()
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
await get_tree().process_frame
|
await get_tree().process_frame
|
||||||
|
@ -17,8 +18,10 @@ func collect():
|
||||||
print("Collected crystal")
|
print("Collected crystal")
|
||||||
value += addAmount
|
value += addAmount
|
||||||
if value != 100.0:
|
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")
|
Player.stream = load("res://collectables/crystal/sounds/Picked Coin Echo.wav")
|
||||||
else:
|
else:
|
||||||
|
Player.pitch_scale = 1.0;
|
||||||
Player.stream = load("res://collectables/crystal/sounds/Picked Coin Echo 2.wav")
|
Player.stream = load("res://collectables/crystal/sounds/Picked Coin Echo 2.wav")
|
||||||
|
|
||||||
Player.play();
|
Player.play();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user