extends Area2D

export var dir = Vector2(0,-1)
export var speed = 0

func destroy():
	var h = get_parent().hit_scene_2.instance()
	h.global_position = global_position
	get_tree().root.add_child(h)
	queue_free()
	
func _process(delta):
	global_position += dir * speed * delta

func _on_Timer_timeout():
	queue_free()

func _on_bullet_b_area_entered(area):
	if area.name == "home":
		queue_free()
		return
	elif area.name == "player":
		if area.shield == false:
			area.death()
		else:
			destroy()
		return
	destroy()
	