script_enemy_main{

let time=0;
let miny=GetClipMinY; let maxy=GetClipMaxY; let minx=GetClipMinX; let maxx=GetClipMaxX;
let cx=GetCenterX; let cy=GetCenterY;

let effect1=0;
let fade=0;

let EFline=("\script\Images\Menu\ItemLine.png");

@Initialize{
	LoadGraphic("\script\Images\Menu\ItemLine.png");

	SetLife(100);
	SetScore(100);
}

@MainLoop{


if(time==0){

let linepos=0;
if(GetCommonData("PlayerType")!=3){ linepos=160; }
if(GetCommonData("PlayerType")==3){ linepos=200; }

let xsize=400;
let ysize=40;
	effect1=(Obj_Create(OBJ_EFFECT));
	Obj_SetPosition(effect1,cx,linepos);
	ObjEffect_SetScale(effect1,1,1);
	ObjEffect_SetLayer(effect1,1); ObjEffect_SetTexture(effect1,EFline); ObjEffect_SetRenderState(effect1,ALPHA);
	ObjEffect_SetPrimitiveType(effect1,PRIMITIVE_TRIANGLESTRIP); ObjEffect_CreateVertex(effect1,4);
	ObjEffect_SetVertexXY(effect1,0,-(xsize/2),-(ysize/2)); ObjEffect_SetVertexUV(effect1,0,0,0);
	ObjEffect_SetVertexXY(effect1,1,xsize/2,-(ysize/2)); ObjEffect_SetVertexUV(effect1,1,xsize,0);
	ObjEffect_SetVertexXY(effect1,2,-(xsize/2),ysize/2); ObjEffect_SetVertexUV(effect1,2,0,ysize);
	ObjEffect_SetVertexXY(effect1,3,xsize/2,ysize/2); ObjEffect_SetVertexUV(effect1,3,xsize,ysize);
	ObjEffect_SetVertexColor(effect1,0,255,255,255,255); ObjEffect_SetVertexColor(effect1,1,255,255,255,255);
	ObjEffect_SetVertexColor(effect1,2,255,255,255,255); ObjEffect_SetVertexColor(effect1,3,255,255,255,255);
}

ObjEffect_SetVertexColor(effect1,0,fade,255,255,255); ObjEffect_SetVertexColor(effect1,1,fade,255,255,255);
ObjEffect_SetVertexColor(effect1,2,fade,255,255,255); ObjEffect_SetVertexColor(effect1,3,fade,255,255,255);

if(time<40 && fade<255){ fade+=255/40; }
if(time>=140 && fade>0){ fade-=255/40; }

if(time>40 && fade<=0){ Obj_Delete(effect1); VanishEnemy; }

time++;

}

}