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

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

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

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

	task Shot(level){
	loop(40){yield;}
	SplitShot(GetX,GetY,3,GetAngle,BLUE02,10,30,15,10,level * 4 + 3,2,0.1,3,90,10,BLUE12);
	}

	task Move(){
	if(GetX == 0){SetMovePosition02(64,GetY,20);}
	else if(GetX >= 0){SetMovePosition02(384,GetY,20);}
	loop(150){yield;}
	if(GetX == 64){SetMovePosition02(448,GetY,120);}
	else if(GetX == 384){SetMovePosition02(0,GetY,120);}
	loop(150){yield;}
	VanishEnemy;
	}

}