
	#Title[zako1]
	#Text[zako]
	#ScriptVersion[2]
	
	script_enemy_main
	{
        let img = "script\ƒUƒR\zako4.PNG";
        let frame = 0;
let scoa=0;
let as=GetAngleToPlayer;
      LoadCommonData;
		@Initialize
		{ 
              SetLife(3000);
       
              SetTimer(60);
           SetEffectForZeroLife(0,0,0);

              LoadGraphic(img);
              SetTexture(img);  SetGraphicRect(0, 0, 64, 64);
             TMain;
		
		}
			
		@MainLoop
		{
            
    SetCollisionA(GetX, GetY, 24);
    SetCollisionB(GetX, GetY, 24);
   yield;


		}
		
		@DrawLoop
		{
		   DrawGraphic(GetX, GetY);
		}
			
		@Finalize
		{
if(scoa==0){
AddScore(500+500*GetPlayerLife);scoa=1;}
		}
         task TMain{
               yield;
                   move;
                  loop{
                    move2;
                  shot;
loop(20) { yield; }
as=GetAngleToPlayer;
                  loop(10) { CreateShot02(GetX, GetY, 0, as,1,14, YELLOW04, 30); 
 CreateShot02(GetX, GetY, 0, as-10,1,14, YELLOW04, 30);
 CreateShot02(GetX, GetY, 0, as+10,1,14, YELLOW04, 30);

loop(2) { yield; } }
                    move2;
                    loop(3){
                    shot2;                  
               loop(10) { yield; } 
}
loop(60) { yield; } 
                    }

                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetCenterX, GetClipMinY+150,30);



        loop(30) { yield; }
                  }
      sub move2{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetPlayerX, GetY,30);



        loop(60) { yield; }
                  }
         sub shot{   loop(20){
                   CreateShot02(GetX, GetY, 7, 270+rand(-50,50),-0.2,-5, BLUE02, 20);
               loop(5) { yield; } 
                  CreateShot02(GetX, GetY, 7, 270+rand(-50,50),-0.2,-5, AQUA03, 20);
               loop(5) { yield; } 
                           }
        
        loop(60) { yield; } 
                 }
  task shot2{ 
                   CreateShot02(GetX, GetY, 7, 270+rand(-40,40),0,0, AQUA03, 30);
               loop(90) { yield; } 
let X=rand(GetClipMinX,GetClipMaxX);
CreateShotA(35,X,GetClipMinY,0);
SetShotDataA(35,0,13,90,0,-0.01,0,AQUA03);
SetShotDataA(35,30,NULL,90,0,-1,0,AQUA03);
SetShotKillTime(35,300);
FireShot(35);
 loop(60) { yield; }
 loop(135) { CreateShot02(X, GetClipMinY, 14, 90,0,7, YELLOW04, 20); loop(2) { yield; } }
                 }

        sub nige{ 
              SetMovePosition02(GetX, GetClipMaxY, 180);
        loop(180) { yield; } 
             VanishEnemy;
                }
	}

