
	#Title[zako1]
	#Text[zako]
	#ScriptVersion[2]
	
	script_enemy_main
	{
        let img = "script\ƒUƒR\zako3.PNG";
        let frame = 0;

      LoadCommonData;
		@Initialize
		{ 
              SetLife(250);
              SetScore(GetLife/2+GetLife/2*GetPlayerLife);
              LoadGraphic(img);
              SetTexture(img);  SetGraphicRect(0, 0, 64, 64);
             TMain;
		
		}
			
		@MainLoop
		{
              SetScore(125+125*GetPlayerLife);
    SetCollisionA(GetX, GetY, 24);
    SetCollisionB(GetX, GetY, 24);
   yield;


		}
		
		@DrawLoop
		{
		   DrawGraphic(GetX, GetY);
		}
			
		@Finalize
		{
  DeleteEnemyShot(CHILD);
		}
         task TMain{


                    shot;
                    nige;

                   }
         sub move{ let x =rand(64, 384);
                   let y =rand(240, 48);
     SetMovePosition02(GetX, GetY,30);
        loop(30) { yield; }
                  }
         sub shot{
 CreateLaserB(35,270,30,PURPLE01,30);
SetLaserDataB(35,0,0,0,0,0,0,GetArgument,0);
SetShotKillTime(35,360);
FireShot(35);

}
        sub nige{ 
if(GetX<GetCenterX){
                   SetMovePosition02(GetX+30, GetY,30);
        loop(30) { yield; } 
              SetMovePosition02(GetClipMaxX+30, GetY, 300);
        loop(300) { yield; } 
             VanishEnemy;
                }
              else{
                   SetMovePosition02(GetX-30, GetY,30);
        loop(30) { yield; } 
              SetMovePosition02(GetClipMinX-30, GetY, 300);
        loop(300) { yield; } 
             VanishEnemy;
                }
	}
  }
