2024-08-20 01:09:36 +00:00
|
|
|
class_name Coin extends Area2D
|
2024-08-13 01:10:32 +00:00
|
|
|
|
2024-08-20 01:09:36 +00:00
|
|
|
signal coinCollected
|
2024-08-13 01:10:32 +00:00
|
|
|
|
|
|
|
func _on_body_entered(body):
|
|
|
|
print("somebody hit a coin")
|
|
|
|
if body.is_in_group("player"):
|
2024-08-20 01:09:36 +00:00
|
|
|
coinCollected.emit()
|
2024-08-13 01:10:32 +00:00
|
|
|
queue_free()
|