Files
GodotCourse/week6/updated_project/scripts/coin.gd
T

9 lines
215 B
GDScript
Raw Normal View History

2024-08-19 15:27:40 -04:00
class_name Coin extends Area2D
2024-08-19 11:21:33 -04:00
2024-08-19 15:27:40 -04:00
#Note: signal created - better to 'signal up' and 'call down'
2024-08-19 11:21:33 -04:00
signal coinCollected
func _on_body_entered(body):
if body.is_in_group("player"):
coinCollected.emit()
queue_free()