Sound added

This commit is contained in:
PfandBoss
2022-12-10 23:27:14 +01:00
parent a118fad15e
commit cd6cd181d2
5 changed files with 18 additions and 4 deletions

View File

@@ -8,18 +8,20 @@ enum TYPE {AMMO, GUNPOWDER, COAL}
@export var currentType: TYPE
@export var audioClip : AudioStreamWAV
#------------Methods-------------#
func _ready():
var root = get_tree().root.get_child(0)
#root.ammo_pickup.connect(_on_signal_storing)
maxStashValue = 10
currentStashValue = 10
$AudioStreamPlayer.stream = audioClip
func interact(player):
if currentStashValue >= 1:
currentStashValue -= 1
player.fill_inventory(currentType)
$AudioStreamPlayer.play()
return
func _on_signal_storing():