script_enemy_main
{
	#include_function ".\Bullet_function.txt"
	#include_function ".\Enemy function.txt"

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(150);
	SetScore(200);
	SetDamageRate(100,33);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(0,128,32,160);
	Shot(GetArgument);
	Move();
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	if(BeVanished() == false){
	MasicPointAddNormal(1);
	loop(3 + scorebonus){
	let x = GetX + rand(-16,16);
	let y = GetY + rand(-16,16);
	CreateItem(ITEM_SCORE,x,y);
	}
	}
	}

	task Shot(level){

	loop(60){yield;}

	let angle = GetAngleToPlayer;
	let angleA = angle + 45;
	let angleB = angle - 45;

	loop{
	loop(12 - level * 2){yield;}
	CreateShot01(GetX,GetY,2,angle,AQUA01,32);
	if(level >= 1){
	CreateShot01(GetX,GetY,2,angleA,AQUA05,32);
	CreateShot01(GetX,GetY,2,angleB,AQUA05,32);
	if(level >= 2){
	CreateShot01(GetX,GetY,2,angleA+90,AQUA05,32);
	CreateShot01(GetX,GetY,2,angleB-90,AQUA05,32);
	}
	if(level >= 3){
	CreateShot01(GetX,GetY,2,angleA+180,AQUA05,32);
	CreateShot01(GetX,GetY,2,angleB-180,AQUA05,32);
	}
	angleA -= 4.3;
	angleB += 4.3;
	}

	}
	}

	task Move(){
	SetMovePosition02(GetX,GetCenterY-60,40);
	loop(420){yield;}
	SetMovePosition02(GetX,0,40);
	loop(45){yield;}
	VanishEnemy;
	}

}