13 lines
175 B
GDScript3
13 lines
175 B
GDScript3
|
class_name Coin extends Area2D
|
||
|
|
||
|
signal coinCollected
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
func _on_body_entered(body: Node2D) -> void:
|
||
|
if body.is_in_group("player"):
|
||
|
coinCollected.emit()
|
||
|
queue_free()
|
||
|
|