script_enemy_main{

let fadeblack=0;
let fadecolor=GetArgument;
let fade=0;

let time=0;
let EFblack=("\script\Images\OtherEffects\Wall.png");
let cx2=320;
let cy2=240;

@Initialize{
	SetLife(1);

	LoadGraphic("\script\Images\OtherEffects\Wall.png");
}

@MainLoop{

if(time==0){
	fadeblack=(Obj_Create(OBJ_EFFECT)); Obj_SetPosition(fadeblack,cx2,cy2); ObjEffect_SetLayer(fadeblack,0); ObjEffect_SetTexture(fadeblack,EFblack);
	ObjEffect_SetPrimitiveType(fadeblack,PRIMITIVE_TRIANGLESTRIP); ObjEffect_CreateVertex(fadeblack,4); ObjEffect_SetRenderState(fadeblack,ALPHA);
	ObjEffect_SetVertexXY(fadeblack,0,-320,-240); ObjEffect_SetVertexUV(fadeblack,0,0,0);
	ObjEffect_SetVertexXY(fadeblack,1,320,-240); ObjEffect_SetVertexUV(fadeblack,1,640,0);
	ObjEffect_SetVertexXY(fadeblack,2,-320,240); ObjEffect_SetVertexUV(fadeblack,2,0,480);
	ObjEffect_SetVertexXY(fadeblack,3,320,240); ObjEffect_SetVertexUV(fadeblack,3,640,480);
}
	ObjEffect_SetVertexColor(fadeblack,0,fade,fadecolor,fadecolor,fadecolor); ObjEffect_SetVertexColor(fadeblack,1,fade,fadecolor,fadecolor,fadecolor);
	ObjEffect_SetVertexColor(fadeblack,2,fade,fadecolor,fadecolor,fadecolor); ObjEffect_SetVertexColor(fadeblack,3,fade,fadecolor,fadecolor,fadecolor);

	if(time<45){ fade+=255/45; }
	if(time>=60){ fade-=255/45; }
	if(time>=60 && fade<=0){ VanishEnemy; }
time++;
}

}