10 lines
207 B
GDScript
10 lines
207 B
GDScript
class_name Coin
|
|
extends Area2D
|
|
|
|
signal coin_collected(body, coin)
|
|
|
|
func _on_body_entered(body: Node2D) -> void:
|
|
print_debug("body connected with coin")
|
|
if body is Player:
|
|
coin_collected.emit(body, self)
|