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

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(280);
	SetDamageRate(100,25);
	SetScore(1200);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(320,192,384,256);
	Shot(GetArgument);
	Move();
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

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

	task Shot(level){
	loop(50){yield;}
	loop{
	SprialShot(level);	
	loop(400){yield;}
	}
	}

	task Move(){
	if(GetX <= GetCenterX){SetMovePosition02(GetClipMaxX+32,GetY,480);}
	if(GetX >= GetCenterX){SetMovePosition02(GetClipMinX-32,GetY,480);
	SetGraphicRect(448,192,512,256);}
	loop(500){yield;}
	VanishEnemy;
	}

}