extends Area2D


onready var bot = preload("res://GD_scene/bot.tscn")


func _ready():
	$bot/anim.play("animation")
	$bot/spawn.play("spawn")
	pass


# warning-ignore:unused_argument
func _physics_process(delta):
	if Global.game_over == true:
		queue_free()
	pass


func _on_spawn_timeout():
	var _color
	
	var spawn = bot.instance()
	
	randomize()
	_color = randi() % 3 + 1
	
	spawn.position = get_node(".").global_position
	get_tree().get_root().add_child(spawn)
	queue_free()
	pass
