
script_enemy_main
{    
   let imgEnemy="script\DanMUku\Stage4\Image\j64.png";
   let count=0;
   let fini=0;
   let x=GetX;
   @Initialize
   {
            LoadGraphic(imgEnemy);
            SetLife(15);  
            CreateEventFromScript("name");
   }
   
   @MainLoop
   {
	if(count==50){
		SetSpeed(0);
	}
	if(fini==0){
	if(GetEventStep==1){
		SetSpeed(4);
		SetAngle(200);
		fini=1;
		count=-100;
	}}
	if(GetX<GetClipMinX-10){
		VanishEnemy;
	}
      count++;
   }
   
   @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(0,0,36,43);
            DrawGraphic(GetX,GetY);
   }
}

script_event name{

@Initialize{
  LoadGraphic("script\DanMUku\Joueur\KorA\Kordialogue.png");
  LoadGraphic("script\DanMUku\Stage4\Image\j64cutin.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\j64cutin.png");
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(LEFT, FRONT);
TextOutB(120,"\c[BLUE] Aaaah, aaaah. J64!");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutB(120,"\c[RED] Wooah! Fast!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutB(120,"\c[BLUE] Let me kick your... behind!");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutB(120,"\c[RED]I can't fight you now.");
SetStep(1);
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutB(120,"\c[BLUE] Come back already!");
End;
}

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