Files
leo-game/coin.gd
2026-05-17 17:18:54 +02:00

16 lines
388 B
GDScript

extends Area2D
@onready var sprite: AnimatedSprite2D = $sprite
@onready var coin_sound: AudioStreamPlayer = $coin_sound
func _on_body_entered(body: Node2D) -> void:
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.