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

	@Initialize{
	SetX(GetX);
	SetY(GetY);
	SetLife(400);
	SetDamageRate(100,33);
	SetScore(750);
	LoadGraphic(imgzako);
	SetTexture(imgzako);
	SetGraphicRect(256,0,320,64);
	Shot(GetArgument);
	Move();
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	if(BeVanished() == false){
	MasicPointAddNormal;
	loop(5 + 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(4){
	AroundToShot(GetX,GetY,96,20,0,1,90,0,false,false,WHITE05,20);
	if(level >= 1){AroundToShot(GetX,GetY,64,20,0,1,67,0,false,false,WHITE05,20);}
	if(level >= 2){AroundToShot(GetX,GetY,32,20,0,1,45,0,false,false,WHITE05,20);}
	if(level >= 3){AroundToShot(GetX,GetY,16,20,0,1,23,0,false,false,WHITE05,20);}
	loop(50){yield;}
	if(level >= 1){WideShot01(GetX,GetY,3,GetAngleToPlayer,10,level * 3,GREEN32,0);}
	loop(50){yield;}
	}
	loop{yield;}
	}

	task Move(){
	SetMovePosition02(GetX,496,780);
	loop(800){yield;}
	VanishEnemy;
	}

}