script_enemy_main
{    
    let imgEnemy="script\DanMUku\Stage5\Image\Maskass.png";
    let count=-100;
    let a=50;
    let b=70;
    let player = 0;
    let angle = GetAngle;
	let tir ="script\DanMUku\Stage1\Son\tir.wav";

   @Initialize
   {
      LoadGraphic(imgEnemy);
	LoadSE(tir);
            SetLife(700); 
   }
   
   @MainLoop
   {
          SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 8);

if(count%10==0)
{
if(a==122)
{
a=50;
b=70;
}
else
{
a+=24;
b+=24;
}
}
if(count==50)
{
SetSpeed(0);
}
if (count>50 && count%5==0 && count<300) {
	CreateShot02(GetX, GetY, 5, GetAngleToPlayer+rand(-5,5), -0.05, 3, BLUE01, 10);
	PlaySE(tir);
}

if(count==400&&angle<=90)
{
SetSpeed(3);
SetAngle(angle+90);
}
if(count==400&&angle>90)
{
SetSpeed(3);
SetAngle(angle-90);
}
angle=GetAngle;
count++;
   }
   @Finalize
   {
	if (GetY<GetClipMaxY) {
		DeleteEnemyShotToItem(CHILD);
		loop(6)
		{
			CreateItem(ITEM_SCORE, rand(GetX-10, GetX+10), rand(GetY-10, GetY+10));  
		}
	}
	
}
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
            SetGraphicRect(a, 3, b, 33);
            DrawGraphic(GetX,GetY);
if(GetAngle>=90 && GetAngle<=270)
{
SetGraphicAngle(180, 0, 0);
}
else
{
SetGraphicAngle(0, 0, 0);
}
   }
}
