GodotCourse/scripts/coin.gd

9 lines
153 B
GDScript3
Raw Normal View History

class_name Coin extends Area2D
2024-08-13 01:10:32 +00:00
signal coinCollected
2024-08-13 01:10:32 +00:00
func _on_body_entered(body):
if body.is_in_group("player"):
coinCollected.emit()
2024-08-13 01:10:32 +00:00
queue_free()