enemyadder.gd 477 B

12345678910111213141516171819202122
  1. extends Position2D
  2. # Declare member variables here. Examples:
  3. # var a = 2
  4. # var b = "text"
  5. var loader = load('res://npc.tscn')
  6. func _ready():
  7. while true:
  8. print('add enemy')
  9. var instancer = loader.instance()
  10. instancer.global_position = global_position
  11. add_child(instancer)
  12. yield(get_tree().create_timer(5.0),"timeout")
  13. pass # Replace with function body.
  14. # Called every frame. 'delta' is the elapsed time since the previous frame.
  15. #func _process(delta):
  16. # pass