script_enemy_main
{
    let count=0;//

    @Initialize
{
	SetLife(20);
	SetScore(50000);
	SetGraphicRect(256,320,288,352);
	LoadUserShotData(GetCurrentScriptDirectory~".\shot_All.txt");
}

@MainLoop
{
	if (GetArgument==0) {
		if (count>0) {
			SetSpeed(2.5);
			SetAngle(180);
		}
		if (count>140) {
			if (GetX<=-20|| GetX>=480||GetY<=-100||GetY>=750) {
				VanishEnemy;
			}
		}
		if (count>=25&&count%19==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			CreateShot12(GetX(),GetY(),rand(-0.4,1),rand(0,-1),0,0.03,0,8,YELLOW04,15);
			CreateShot12(GetX(),GetY(),rand(-0.4,1),rand(0,-1),0,0.03,0,8,YELLOW04,15);
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),9);
			SetCollisionB(GetX(),GetY(),7);
		}
	}

	if (GetArgument==1) {
		if (count>0) {
			SetSpeed(2.5);
			SetAngle(0);
		}
		if (count>140) {
			if (GetX<=-20|| GetX>=480||GetY<=-100||GetY>=750) {
				VanishEnemy;
			}
		}
		if (count>=25&&count%19==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			CreateShot12(GetX(),GetY(),rand(-1,0.4),rand(0,-1),0,0.02,0,8,YELLOW04,15);
			CreateShot12(GetX(),GetY(),rand(-1,0.4),rand(0,-1),0,0.02,0,8,YELLOW04,15);
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),9);
			SetCollisionB(GetX(),GetY(),7);
		}
	}

	if (GetArgument==2) {
		if (count>0) {
			SetSpeed(2.5);
			SetAngle(180);
		}
		if (count>140) {
			if (GetX<=-20|| GetX>=480||GetY<=-100||GetY>=750) {
				VanishEnemy;
			}
		}
		if (count>=25&&count%19==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			CreateShot12(GetX(),GetY(),rand(-0.1,0.2),rand(0,-1),0,0.03,0,8,BLUE02,15);
			CreateShot12(GetX(),GetY(),rand(-0.1,0.2),rand(0,-1),0,0.03,0,8,BLUE02,15);
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),9);
			SetCollisionB(GetX(),GetY(),7);
		}
	}

	if (GetArgument==3) {
		if (count>0) {
			SetSpeed(2.5);
			SetAngle(0);
		}
		if (count>140) {
			if (GetX<=-20|| GetX>=480||GetY<=-100||GetY>=750) {
				VanishEnemy;
			}
		}
		if (count>=25&&count%19==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			CreateShot12(GetX(),GetY(),rand(-0.2,0.1),rand(0,-1),0,0.02,0,8,BLUE02,15);
			CreateShot12(GetX(),GetY(),rand(-0.2,0.1),rand(0,-1),0,0.02,0,8,BLUE02,15);
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),9);
			SetCollisionB(GetX(),GetY(),7);
		}
	}

	count++;

}

@Finalize
{
	if (BeVanished==false) {
		CollectItems;
		CreateItem(ITEM_SCORE,GetX(),GetY()+20);
	}
}

@DrawLoop
{
	SetTexture(GetCurrentScriptDirectory~"img\dot-kaze-ti.png");
	SetColor(255,255,255);
	SetGraphicScale(1.1,1.1);

	if (count/3%4==0) {
		SetGraphicRect(256,320,288,352);
	}
	if (count/3%4==1) {
		SetGraphicRect(288,320,320,352);
	}
	if (count/3%4==2) {
		SetGraphicRect(256,352,288,384);
	}
	if (count/3%4==3) {
		SetGraphicRect(288,352,320,384);
	}

	if (GetArgument==1||GetArgument==3) {
		if (count/3%4==0) {
			SetGraphicRect(320,320,352,352);
		}
		if (count/3%4==1) {
			SetGraphicRect(352,320,384,352);
		}
		if (count/3%4==2) {
			SetGraphicRect(320,352,352,384);
		}
		if (count/3%4==3) {
			SetGraphicRect(352,352,384,384);
		}
	}

	DrawGraphic(GetX(),GetY());
}
}
