coin sound
This commit is contained in:
11
coin.gd
11
coin.gd
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user