coin sound

This commit is contained in:
2026-05-17 16:04:28 +02:00
parent 197d274d1f
commit 57da0c302e
4 changed files with 25 additions and 7 deletions

11
coin.gd
View File

@@ -1,6 +1,15 @@
extends Area2D
@export var coin_sound: AudioStreamPlayer
@export var sprite: AnimatedSprite2D
func _on_body_entered(body: Node2D) -> void:
print("you got coing")
if sprite != null:
print("you got coin " + name)
coin_sound.play()
sprite.queue_free()
pass # Replace with function body.
func _on_coin_sound_finished() -> void:
queue_free()
pass # Replace with function body.