#Title[th[ʏP]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	#include_function ".\eW.txt"
	let frame   = 0;

	@Initialize{
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(4000);
	SetTimer(69);
	SetDamageRate(150,15);

	LoadGraphic(imgboss62);
	SetTexture(imgboss62);
	SetGraphicRect(0,0,127,127);
	Shot(0);
	Move();
	}

	@MainLoop{
	SetCollisionA(GetX,GetY,24);
	SetCollisionB(GetX,GetY,24);
	ChackBonus;
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	DeleteGraphic(imgboss62);
	}

	task Shot(level){
	let angle;
	loop(120){yield;}
	loop{
	angle = 90 + rand(-10,10);
	loop(20){yield;}
	if(level <= 1){
	Allshot(2.5,angle,level * 6 + 30,BLUE12,0);
	Allshot(2.9,angle,level * 6 + 30,BLUE12,0);	
	}
	if(level >= 2){
	loop(5){yield;}
	Allshot(2.5,angle,40,RED12,0);
	Allshot(2.9,angle+4,40,RED12,0);
	if(level == 3){
	Allshot(3.3,angle+8,40,RED12,0);
	}
	}
	}
	}

	task Move(){
	loop{
	loop(70){yield;}
	SetMovePosition02(GetPlayerX + rand(-20,20),rand(32,128),60);
	}
	}

}