You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 line
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()