25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
400 B

  1. extends Area
  2. signal picked_up
  3. export var goldToGive : int = 1
  4. var rotateSpeed : float = 5.0
  5. # called every frame
  6. func _process (delta):
  7. # rotate along the Y axis
  8. rotate_y(rotateSpeed * delta)
  9. func on_touch(interactor : KinematicBody):
  10. # is this the player? If so give them gold
  11. if interactor.is_in_group("Player"):
  12. interactor.give_gold(goldToGive)
  13. emit_signal("picked_up")
  14. queue_free()