
script_enemy_main
{    
   let imgEnemy="script\DanMUku\Stage1\Image\Machin.png";
   let count=0;
    let z = 0;
    let w = 0.5;

   @Initialize
   {
            LoadGraphic(imgEnemy);
            SetLife(1);
            SetEnemyMarker(true);
            SetInvincibility(150);
            CreateEnemyFromScript("j64", 300, 0, 0, 0, 0);
            CreateEventFromScript("name");
		SetMovePosition02(GetCenterX, GetCenterY - 100, 60);
   }
   
   @MainLoop
   {
	if (!OnEvent) {
		AddLife(-1);
	}


      count++;
   }
   
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 24, 24);
            DrawGraphic(GetX,GetY+z);
     if(z==10){w=-0.5;}
     if(z==-10){w=0.5;}
	z+=w;

   }
}

script_event name{

  let j64 = "script\DanMUku\Stage4\Image\j64cutin.png";
  let machin = "script\DanMUku\Stage1\Image\Machincutin.png";
  let kor = "script\DanMUku\Joueur\KorA\Kordialogue.png";

@Initialize{
  LoadGraphic(kor);
  LoadGraphic(j64);
  LoadGraphic(machin);
 }


@MainLoop{   
 SetChar(LEFT, kor);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);        
SetChar(RIGHT, machin);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Kor!\n Stop!");
SetChar(RIGHT, j64);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
TextOutA("\c[RED] We will avenge General Full_Korbe!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] This tower will collapse, \nlet me go!.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] No!");
 SetChar(RIGHT, machin);                   
SetGraphicRect(RIGHT, 0, 0, 121, 214); 
TextOutA("\c[RED] On our dead bodies.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] As you wish.");
End;


}

 @Finalize{
  DeleteGraphic(kor);
  DeleteGraphic(machin);
  DeleteGraphic(j64);
 }
}

script_enemy j64{


    let imgEnemy ="script\DanMUku\Stage4\Image\j64.png";


@Initialize{
    SetLife(1);
    LoadGraphic(imgEnemy);
	SetMovePosition02(GetCenterX+50, GetCenterY - 140, 60);

 }
@MainLoop{

 }
@DrawLoop{
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 35, 43);
            DrawGraphic(GetX,GetY);

 }
@Finalize{
     DeleteGraphic(imgEnemy);
 }

}

