GodotCourse/week6/updated_project/scripts/coin.gd
2026-09-29 13:40:24 -04:00

10 lines
215 B
GDScript
Executable File

class_name Coin extends Area2D
#Note: signal created - better to 'signal up' and 'call down'
signal coinCollected
func _on_body_entered(body):
if body.is_in_group("player"):
coinCollected.emit()
queue_free()