GodotGame/scripts/coin.gd

10 lines
188 B
GDScript3
Raw Normal View History

2024-08-20 01:07:42 +00:00
class_name Coin extends Area2D
2024-08-13 01:01:40 +00:00
2024-08-20 01:07:42 +00:00
signal coinCollected
2024-08-13 01:01:40 +00:00
func _on_body_entered(body):
if body.is_in_group("player"):
print("somebody entered a coin")
2024-08-20 01:07:42 +00:00
coinCollected.emit()
2024-08-13 01:01:40 +00:00
queue_free()