16 lines
362 B
GDScript
16 lines
362 B
GDScript
extends Area2D
|
|
@export var coin_sound: AudioStreamPlayer
|
|
@export var sprite: AnimatedSprite2D
|
|
|
|
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.
|