GodotProject/scripts/coin.gd

10 lines
187 B
GDScript3
Raw Permalink Normal View History

2024-08-20 01:18:41 +00:00
class_name Coin extends Area2D
2024-08-20 01:18:41 +00:00
signal coinCollected
func _on_body_entered(body):
if body.is_in_group("player"):
print("something hit the coin")
2024-08-20 01:18:41 +00:00
coinCollected.emit()
queue_free()