JeremyGodot/scripts/coin.gd

10 lines
187 B
GDScript3
Raw Normal View History

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