

script_enemy_main
{    
    let imgEnemy ="script\DanMUku\Stage4\Image\fdrstar.png";
    let count = -50;
    let tir ="script\DanMUku\Stage1\Son\tir.wav";
    let munch ="script\DanMUku\Stage1\Son\muncher.wav";
    let a=0;
    let b=55;
    let x=GetX;
    let c=0;
    let angle=0;

 function Wait(let frames){
   loop(frames){yield;}
 }

   @Initialize
   {
            LoadUserShotData("lib\MUtir\MUtir.txt");
            LoadGraphic(imgEnemy);
            SetLife(1);
            SetTimer(9999);
            SetInvincibility(100);
            SetEnemyMarker(true);
            SetMovePosition02(GetCenterX, GetCenterY-100, 50);   
	    CreateEventFromScript("name");
           
   }
   
   @MainLoop
   {
	if (!OnEvent) {
		AddLife(-1);
	}
if(count%10==0){
	if(a==0){a=55;b=112;c=0;}
	else if(a==55&&c==0){a=112;b=168;}
	else if(a==55&&c==1){a=0;b=55;}
	else{a=55;b=112;c=1;}
}

count++;
yield;
   }
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @DrawLoop
   {
	if(x>GetX){
		SetGraphicAngle(180,0,0);
	}
	if(x<GetX){
		SetGraphicAngle(0,0,0);
	}
      x=GetX;
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
            SetGraphicRect(a, 0, b, 64);
            DrawGraphic(GetX,GetY);

	DrawText("FdRstar", GetClipMinX+10, GetClipMinY+15, 12, 255);
   }

}

script_event name{

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

@MainLoop{
 SetChar(LEFT, "script\DanMUku\Joueur\KorA\Kordialogue.png");                   
SetGraphicRect(LEFT, 0, 0, 121, 214);           
MoveChar(LEFT, BACK);
SetChar(RIGHT, "script\DanMUku\Stage4\Image\FdRcutin.png");
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Hep hep hep ! \nNo passing here.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] What are you doing here, FdR?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
SetNameFromText (RIGHT, TEXT_YELLOW, "FdRstar", "Switchy guardian");
TextOutA("\c[RED] I ensure non-authorised members\ndon't get in the tower.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
DeleteName(RIGHT);
TextOutA("\c[BLUE] I feel you would fit better\nin the park.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] So... You found this tower, huh?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Hard to miss, isn't it?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] You say that, but before you were\npointed to it, you didn't notice it.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Hum... That's true.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Anyway, Kor... I would have gladly let you pass. \nIf you came before I switched sides.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
PlayMusic("script\DanMUku\Stage4\FdRstar.mp3");
TextOutA("\c[BLUE] Huh? That means you betrayed us...\n(I guess.)");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Of course! If I didn't,\nI wouldn't be a boss right now!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] What are you babbling?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Oh, sorry! I forgot I'm the only one\nwho can break the fourth wall!");
End;
}

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