2048-Shooter/Spawner.gd
2022-11-24 16:00:50 +01:00

21 lines
393 B
GDScript

extends Panel
var enemy_pre = preload("res://Entity.tscn")
var enemy = null
var Time = 0
# Called when the node enters the scene tree for the first time.
func _ready():
if randi() % 2 == 0:
enemy = enemy_pre.instance()
add_child(enemy)
pass
func _process(delta):
Time += delta
if Time > 5:
if randi() % 2 == 0:
enemy = enemy_pre.instance()
add_child(enemy)
Time = 0