script_enemy_main
{    
    let imgEnemy="script\DanMUku\Stage2\Image\Boo.png";
    let count=-100;
    let o =0;
    let angle = 0;
    let d = 0;
    let tir = "script\DanMUku\Stage2\Son\tir.wav";
     let turn = -GetArgument;

   @Initialize
   {
      LoadGraphic(imgEnemy);
      LoadSE(tir);
            SetLife(100); 
   }
   
   @MainLoop
   {
if(count<-38)
{
o+=4;
}
if(count>0&&count<62)
{
o-=4;
}
if(count>100&&count<162)
{
o+=4;
}
if(count>200&&count<262)
{
o-=4;
}
if(count>300&&count<362)
{
o+=4;
}
if(count>400&&count<462)
{
o-=4;
}
if(count>500&&count<562)
{
o+=4;
}
if(count==200)
{
SetSpeed(0);
d=2;
PlaySE(tir);
loop(10){
angle=GetAngleToPlayer-20;
loop(3){
CreateShot01(GetX, GetY, 2, angle, PURPLE11, d);
angle+=20;
}
d+=5;
}
}
if(count==220)
{
SetSpeed(GetArgument);
SetAngle(270*GetArgument);
turn=-turn;
}
if(count==400)
{
SetSpeed(0);
d=2;
PlaySE(tir);
loop(10){
angle=GetAngleToPlayer-20;
loop(3){
CreateShot01(GetX, GetY, 2, angle, PURPLE11, d);
angle+=20;
}
d+=5;
}
}
if(count==420)
{
SetSpeed(-GetArgument);
if(GetArgument==-1)
{
SetAngle(60);
}
if(GetArgument==1)
{
SetAngle(300);
}
}
count++;
yield;
   }
   @Finalize
   {
}
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(o);
            SetTexture(imgEnemy);
            SetGraphicAngle(0,0,0);

if(turn<=0){
            SetGraphicRect(128, 37, 160, 64);
	}
if(turn>0){
            SetGraphicRect(96, 37, 128, 64);
	}
            DrawGraphic(GetX,GetY);

   }
}