|
@@ -1,23 +1,15 @@
|
|
|
extends Position2D
|
|
|
|
|
|
-
|
|
|
-# Declare member variables here. Examples:
|
|
|
-# var a = 2
|
|
|
-# var b = "text"
|
|
|
-
|
|
|
-
|
|
|
var loader = load('res://npc.tscn')
|
|
|
-func _ready():
|
|
|
- while true:
|
|
|
+var buffer = 300
|
|
|
+func _physics_process(delta):
|
|
|
+ buffer -= 1
|
|
|
+ if buffer == 0:
|
|
|
+ buffer = 300
|
|
|
if get_child_count() < 5:
|
|
|
print('add enemy')
|
|
|
var instancer = loader.instance()
|
|
|
instancer.global_position = global_position
|
|
|
add_child(instancer)
|
|
|
- yield(get_tree().create_timer(5.0),"timeout")
|
|
|
- pass # Replace with function body.
|
|
|
-
|
|
|
|
|
|
-# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
-#func _process(delta):
|
|
|
-# pass
|
|
|
+ pass # Replace with function body.
|