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

	@Initialize{
	SetCommonData("E27B_X",GetX);
	SetCommonData("E27B_Y",GetY);
	SetX(GetClipMaxX+16);
	SetY(0);
	SetLife(60);
	SetScore(90);
	SetDamageRate(100,33);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(0,256,32,288);
	Shot(GetArgument);
	Move();
	SetInvincibility(50);
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

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

	task Shot(level){
	loop{
	loop(100){yield;}
	let angle = GetAngle;
	loop(level + 1){
	Allshot(2,angle,15,PURPLE05,15);
	loop(80 / (level + 1)){yield;}
	}
	}
	}

	task Move(){
	yield;
	SetMovePosition02(GetCommonData("E27B_X"),GetCommonData("E27B_Y"),80);
	loop(160){yield;}
	let direct = GetX;
	if(direct >= GetCenterX){SetMovePosition02(GetCenterX,GetClipMinY - 16,120);}
	else if(direct < GetCenterX){SetMovePosition02(GetCenterX,GetClipMaxY - 16,120);}
	loop(160){yield;}
	VanishEnemy;
	}


}