extends Node

var enemy = preload('res://Enemy.tscn')
export var wave_num = 10

func _ready():
	yield(get_tree().create_timer(1.0),"timeout")
	while true:
		for x in wave_num:
			var instance = enemy.instance()
			var rot = rand_range(-PI,PI)
			instance.global_position = Vector2(sin(rot), cos(rot)) * 640
			add_child(instance)
		yield(get_tree().create_timer(10.0),"timeout")

var counter = 0

var score = {}

func death_count(id):
	if score.has(id):
		score[id] += 1
	else:
		score[id] = 1
	get_parent().kill_update(score[id],id)
