script_enemy_main{


    let imgEnemy ="script\DanMUku\Stage4\Image\fdrstar.png";
    let a=0;
    let b=55;
    let x=GetX;
    let c=0;
    let count = -9;
    let pasTrois = true;

@Initialize{
    SetLife(1);
SetInvincibility(150);
    LoadGraphic(imgEnemy);
	SetMovePosition02(GetCenterX+60, GetCenterY - 100, 60);

 }
@MainLoop{

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;}
}


	if (OnEvent){
		if (GetEventStep==3&&pasTrois) {
			SetMovePosition02(0, GetCenterY - 100, 60);
			pasTrois = false;
		}	
	}

	count++;
	yield;

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

 }
@Finalize{
     DeleteGraphic(imgEnemy);
 }

}
