coin.gd 166 B

12345678
  1. class_name Coin
  2. extends Area2D
  3. var taken = false
  4. func _on_body_enter(body):
  5. if not taken and body is Player:
  6. ($AnimationPlayer as AnimationPlayer).play("taken")