GodotCourse/week5/updated_project/scripts/coin.gd

10 lines
150 B
GDScript3
Raw Permalink Normal View History

2024-08-12 19:19:54 +00:00
extends Area2D
2024-08-12 19:32:24 +00:00
@onready var game = %GameManager
2024-08-12 19:19:54 +00:00
func _on_body_entered(body):
if body.is_in_group("player"):
game.coinCollected()
2024-08-12 21:43:39 +00:00
queue_free()