
	#Title[zako1]
	#Text[zako]
	#ScriptVersion[2]
	
	script_enemy_main
	{
        let img = "script\ƒUƒR\zako.PNG";
        let frame = 0;
        let ang=60;
		@Initialize
		{ 
              SetLife(20);
              SetScore(GetLife/2+GetLife/2*GetPlayerLife);
              LoadGraphic(img);
              SetTexture(img);  SetGraphicRect(0, 0, 64, 64);
             TMain;
		
		}
			
		@MainLoop
		{
              SetScore(10+10*GetPlayerLife);
    SetCollisionA(GetX, GetY, 24);
    SetCollisionB(GetX, GetY, 24);
   yield;
		}
		
		@DrawLoop
		{
		   DrawGraphic(GetX, GetY);
		}
			
		@Finalize
		{

		}
         task TMain{
               yield;
loop{
        SetMovePosition02(GetX,GetClipMaxY-30, 60);
        shot2;
        loop(60){yield;}
       SetMovePosition02(GetClipMaxX-30,GetY, 60);
        loop(60){yield;} 
     shot3;
    SetMovePosition02(GetX,GetClipMinY-30, 60);
        loop(60){yield;} 
      VanishEnemy;
}
                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetX, GetY+3, 1);
         yield;
               }   
         task shot2{     
      loop(12){
CreateShot02(GetX,GetY,0,0,0.1,3,YELLOW04,0);
         loop(5){yield;}
          }
}
         task shot3{     
      loop(9){
  
CreateShot02(GetX,GetY,4,GetAngleToPlayer,0,5,PURPLE04,0);
         loop(5){yield;}
          }
                 }
        sub nige{ 
              SetMovePosition02(GetClipMinX-30, GetY, 60);
        loop(60) { yield; } 
             VanishEnemy;
                }
	}
  
