

script_enemy_main
{   
    let imgEnemy="script\DanMUku\Stage1\Image\Machin.png";
    let z = 0;
    let w = 0.5;
   @Initialize
   {
      LoadGraphic(imgEnemy);
      LoadMusic("script\DanMUku\Stage1\Machin.mp3");
            SetLife(1);
            SetEnemyMarker(true);
            SetMovePosition02(GetCenterX, GetCenterY - 100, 120);
            CreateEventFromScript("name");
   }
   
   @MainLoop
   {

	if (!OnEvent) {
		AddLife(-1);
	}
   }
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
            SetGraphicRect(0,0,16*1.5,16*1.5);
            DrawGraphic(GetX,GetY+z);
     if(z==10){w=-0.5;}
     if(z==-10){w=0.5;}
z+=w;
	DrawText("Machin", GetClipMinX+10, GetClipMinY+15, 12, 255);
   }

}

script_event name{

@Initialize{
  LoadGraphic("script\DanMUku\Joueur\KorA\Kordialogue.png");
  LoadGraphic("script\DanMUku\Stage1\Image\Machincutin.png");
 }

@MainLoop{
 SetChar(LEFT, "script\DanMUku\Joueur\KorA\Kordialogue.png");                 
SetGraphicRect(LEFT, 0, 0, 121, 214);           
MoveChar(LEFT, BACK);
SetChar(RIGHT, "script\DanMUku\Stage1\Image\Machincutin.png");
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Well, who's there? \n KorHosik, our old admin?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] What do you mean, old?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] You know what I meant.");
TextOutA("\c[RED] There has been a coup d'etat.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] So you can't be left alone \na little week or so?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Looks like it.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Fine, I'll take care of that.\n Should be simple enough.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Are you sure?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Let me pass Machin!");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] How disrespectful! \n I am more than a vulgar member now.");
PlayMusic("script\DanMUku\Stage1\Machin.mp3");
SetNameFromText (RIGHT, TEXT_GREEN, "Commander Machin", "Commander of the special intervention troops");
TextOutA("\c[RED] I am the commander of \nthe special intervention troops!");
DeleteName(RIGHT);
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] So, you are with them? \n I see...");
TextOutA("\c[BLUE] I have to defeat you then! \n Prepare yourself!");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Don't be stupid, \n I am much stronger \n than the creatures \nyou have battled before!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] I'll be the judge of that!");
End;
}

 @Finalize{
  DeleteGraphic("player\korHosik\Kordialogue.png");
  DeleteGraphic("script\DanMUku\Stage1\Image\Machincutin.png");
 }
}
