8 lines
160 B
GDScript
8 lines
160 B
GDScript
class_name Coin extends Area2D
|
|
|
|
signal coin_collected(coin: Coin)
|
|
|
|
func _on_body_entered(body: Node2D) -> void:
|
|
if body is Player:
|
|
coin_collected.emit(self)
|