coin.gd 194 B

123456789101112
  1. extends Area
  2. # Member variables
  3. var taken = false
  4. func _on_coin_body_enter(body):
  5. if (not taken and body extends preload("res://player.gd")):
  6. get_node("anim").play("take")
  7. taken = true