Add sound effects for player actions and collectables

This commit is contained in:
2025-04-26 02:15:23 +02:00
parent 8959fd4b9f
commit f01645c094
46 changed files with 897 additions and 1058 deletions

View File

@@ -6,6 +6,7 @@ var has_fade_away: bool = false
@export var area2d: Area2D
@export var collectable_data: CollectableResource
@export var sfx: AudioStreamPlayer2D
signal collected(amount: int)
@@ -24,5 +25,8 @@ func _ready() -> void:
func _on_area2d_body_entered(body: Node2D) -> void:
if body.has_node("CanPickUpComponent"):
collected.emit(collectable_data.amount)
if sfx:
sfx.play()
if not has_fade_away:
await sfx.finished
root.queue_free()