8 lines
160 B
GDScript3
8 lines
160 B
GDScript3
|
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)
|