您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

19 行
382 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(body : KinematicBody):
  10. # is this the player? If so give them gold
  11. if body.is_in_group("Player"):
  12. body.give_gold(goldToGive)
  13. emit_signal("picked_up")
  14. queue_free()