/* 0.12m Code, from TLC
task Alert(long){
	let def		= Obj_Create(OBJ_EFFECT);
	let def2	= [Obj_Create(OBJ_EFFECT),
					Obj_Create(OBJ_EFFECT)];
	let img1	= GetCurrentScriptDirectory~".\enm3eff\al00.png";
	let img2	= GetCurrentScriptDirectory~".\enm3eff\al01.png";
	let alpha1	= 0;
	let alpha2	= 0;
	let move1	= 0;
	let moveA	= 0;
	let kill	= 0;
	let i		= 0;
	
	LoadGraphic(img1);
	LoadGraphic(img2);
	
	Obj_SetPosition(def,CenX,CenY);
	ObjEffect_SetTexture(def,img1);
	ObjEffect_SetRenderState(def,ALPHA);
	ObjEffect_SetPrimitiveType(def,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_SetLayer(def,7);
	ObjEffect_SetScale(def,1,1);
	ObjEffect_CreateVertex(def,4);
	ObjEffect_SetVertexXY(def,0,128/-2,128/-2);
	ObjEffect_SetVertexXY(def,1,128/-2,128/2);
	ObjEffect_SetVertexXY(def,2,128/2,128/-2);
	ObjEffect_SetVertexXY(def,3,128/2,128/2);
	ObjEffect_SetVertexUV(def,0,0,0);
	ObjEffect_SetVertexUV(def,1,0,128);
	ObjEffect_SetVertexUV(def,2,128,0);
	ObjEffect_SetVertexUV(def,3,128,128);
	ObjEffect_SetVertexColor(def,0,alpha1,255,255,255);
	ObjEffect_SetVertexColor(def,1,alpha1,255,255,255);
	ObjEffect_SetVertexColor(def,2,alpha1,255,255,255);
	ObjEffect_SetVertexColor(def,3,alpha1,255,255,255);
	
	loop(2){
		Obj_SetPosition(def2[i],CenX,CenY);
		ObjEffect_SetTexture(def2[i],img2);
		ObjEffect_SetRenderState(def2[i],ALPHA);
		ObjEffect_SetPrimitiveType(def2[i],PRIMITIVE_TRIANGLESTRIP);
		ObjEffect_SetLayer(def2[i],7);
		ObjEffect_SetScale(def2[i],1,1);
		ObjEffect_CreateVertex(def2[i],4);
		ObjEffect_SetVertexXY(def2[i],0,600/-2,244/-2);
		ObjEffect_SetVertexXY(def2[i],1,600/-2,244/2);
		ObjEffect_SetVertexXY(def2[i],2,600/2,244/-2);
		ObjEffect_SetVertexXY(def2[i],3,600/2,244/2);
		ObjEffect_SetVertexUV(def2[i],0,0,0);
		ObjEffect_SetVertexUV(def2[i],1,0,244);
		ObjEffect_SetVertexUV(def2[i],2,600,0);
		ObjEffect_SetVertexUV(def2[i],3,600,244);
		ObjEffect_SetVertexColor(def2[i],0,alpha2,255,255,255);
		ObjEffect_SetVertexColor(def2[i],1,alpha2,255,255,255);
		ObjEffect_SetVertexColor(def2[i],2,alpha2,255,255,255);
		ObjEffect_SetVertexColor(def2[i],3,alpha2,255,255,255);
		i++;
	}i=0;
	ObjEffect_SetAngle(def2[0],0,0,45);
	ObjEffect_SetAngle(def2[1],0,0,-45);
	
	loop{
		kill++;
		loop(2){
			ObjEffect_SetVertexUV(def2[i],0,0+kill,0);
			ObjEffect_SetVertexUV(def2[i],1,0+kill,244);
			ObjEffect_SetVertexUV(def2[i],2,600+kill,0);
			ObjEffect_SetVertexUV(def2[i],3,600+kill,244);
			i++;
		}i=0;
		
		if(alpha1<255&&long>kill){alpha1+=15;}
		if(alpha2<255&&long>kill){alpha2+=15;}
		if(alpha1>0&&long<kill){alpha1-=15;}
		if(alpha2>0&&long<kill){alpha2-=15;}
		ObjEffect_SetVertexColor(def,0,alpha1,255,255,255);
		ObjEffect_SetVertexColor(def,1,alpha1,255,255,255);
		ObjEffect_SetVertexColor(def,2,alpha1,255,255,255);
		ObjEffect_SetVertexColor(def,3,alpha1,255,255,255);
		loop(2){
			ObjEffect_SetVertexColor(def2[i],0,alpha2,255,255,255);
			ObjEffect_SetVertexColor(def2[i],1,alpha2,255,255,255);
			ObjEffect_SetVertexColor(def2[i],2,alpha2,255,255,255);
			ObjEffect_SetVertexColor(def2[i],3,alpha2,255,255,255);
			i++;
		}i=0;
		
		if(alpha1<=0&&alpha2<=0&&long<kill){
			Obj_Delete(def);
			Obj_Delete(def2[0]);
			Obj_Delete(def2[1]);
			break;
		}
		
		yield;
	}
}
*/
task Alert(long){ //ph3 try to port
	let def		= ObjPrim_Create(OBJ_SPRITE_2D);
	let def2	= [ObjPrim_Create(OBJ_SPRITE_2D),
					ObjPrim_Create(OBJ_SPRITE_2D)];
	let img1	= GetCurrentScriptDirectory~"al00.png";
	let img2	= GetCurrentScriptDirectory~"al01.png";
	let alpha1	= 0;
	let alpha2	= 0;
	let move1	= 0;
	let moveA	= 0;
	let kill	= 0;
	let i		= 0;
	
	//LoadGraphic(img1);
	//LoadGraphic(img2);
	
	ObjRender_SetPosition(def,GetStgFrameWidth/2,250,0);
	ObjPrim_SetTexture(def,img1);
	ObjRender_SetBlendType(def,BLEND_ALPHA);
	ObjPrim_SetPrimitiveType(def,PRIMITIVE_TRIANGLESTRIP);
	Obj_SetRenderPriorityI(def,20);
	ObjRender_SetScaleXYZ(def,1,1,1);
	ObjPrim_SetVertexCount(def,4);
	ObjPrim_SetVertexPosition(def,0,128/-2,128/-2,0);
	ObjPrim_SetVertexPosition(def,1,128/-2,128/2,0);
	ObjPrim_SetVertexPosition(def,2,128/2,128/-2,0);
	ObjPrim_SetVertexPosition(def,3,128/2,128/2,0);
	ObjPrim_SetVertexUVT(def,0,0,0);
	ObjPrim_SetVertexUVT(def,1,0,128);
	ObjPrim_SetVertexUVT(def,2,128,0);
	ObjPrim_SetVertexUVT(def,3,128,128);
	ascent(i in 0..4){
	  ObjPrim_SetVertexColor(def,i,255,255,255);
	  ObjPrim_SetVertexAlpha(def,i,alpha1);	
	  }
	//ObjEffect_SetVertexColor(def,0,alpha1,255,255,255);
	//ObjEffect_SetVertexColor(def,1,alpha1,255,255,255);
	//ObjEffect_SetVertexColor(def,2,alpha1,255,255,255);
	//ObjEffect_SetVertexColor(def,3,alpha1,255,255,255);
	
	loop(2){
		ObjRender_SetPosition(def2[i],GetStgFrameWidth/2,250,0);
		ObjPrim_SetTexture(def2[i],img2);
		ObjRender_SetBlendType(def2[i],BLEND_ALPHA);
		ObjPrim_SetPrimitiveType(def2[i],PRIMITIVE_TRIANGLESTRIP);
		Obj_SetRenderPriorityI(def2[i],20);
		ObjRender_SetScaleXYZ(def2[i],1,1,1);
		ObjPrim_SetVertexCount(def2[i],4);
		ObjPrim_SetVertexPosition(def2[i],0,600/-2,244/-2,0);
		ObjPrim_SetVertexPosition(def2[i],1,600/-2,244/2,0);
		ObjPrim_SetVertexPosition(def2[i],2,600/2,244/-2,0);
		ObjPrim_SetVertexPosition(def2[i],3,600/2,244/2,0);
		ObjPrim_SetVertexUVT(def2[i],0,0,0);
		ObjPrim_SetVertexUVT(def2[i],1,0,244);
		ObjPrim_SetVertexUVT(def2[i],2,600,0);
		ObjPrim_SetVertexUVT(def2[i],3,600,244);
		//ObjEffect_SetVertexColor(def2[i],0,alpha2,255,255,255);
		//ObjEffect_SetVertexColor(def2[i],1,alpha2,255,255,255);
		//ObjEffect_SetVertexColor(def2[i],2,alpha2,255,255,255);
		//ObjEffect_SetVertexColor(def2[i],3,alpha2,255,255,255);
		ascent(j in 0..4){
	  ObjPrim_SetVertexColor(def2[i],j,255,255,255);
	  ObjPrim_SetVertexAlpha(def2[i],j,alpha2);	  
	}
		i++;
	}i=0;
	ObjRender_SetAngleXYZ(def2[0],0,0,0);
	ObjRender_SetAngleXYZ(def2[1],0,0,0);
	
	loop{
		kill++;
		loop(2){
			ObjPrim_SetVertexUVT(def2[i],0,0+kill,0);
			ObjPrim_SetVertexUVT(def2[i],1,0+kill,244);
			ObjPrim_SetVertexUVT(def2[i],2,600+kill,0);
			ObjPrim_SetVertexUVT(def2[i],3,600+kill,244);
			i++;
		}i=0;
		
		if(alpha1<255&&long>kill){alpha1+=15;}
		if(alpha2<255&&long>kill){alpha2+=15;}
		if(alpha1>0&&long<kill){alpha1-=15;}
		if(alpha2>0&&long<kill){alpha2-=15;}
		//ObjEffect_SetVertexColor(def,0,alpha1,255,255,255);
		//ObjEffect_SetVertexColor(def,1,alpha1,255,255,255);
		//ObjEffect_SetVertexColor(def,2,alpha1,255,255,255);
		//ObjEffect_SetVertexColor(def,3,alpha1,255,255,255);
		ascent(a in 0..4){
	  ObjPrim_SetVertexColor(def,a,255,255,255);
	  ObjPrim_SetVertexAlpha(def,a,alpha1);	  
	}
		loop(2){
			//ObjEffect_SetVertexColor(def2[i],0,alpha2,255,255,255);
			//ObjEffect_SetVertexColor(def2[i],1,alpha2,255,255,255);
			//ObjEffect_SetVertexColor(def2[i],2,alpha2,255,255,255);
			//ObjEffect_SetVertexColor(def2[i],3,alpha2,255,255,255);
			ascent(b in 0..4){
	  ObjPrim_SetVertexColor(def2[i],b,255,255,255);
	  ObjPrim_SetVertexAlpha(def2[i],b,alpha2);	  
	}
			i++;
		}i=0;
		
		if(alpha1<=0&&alpha2<=0&&long<kill){
			Obj_Delete(def);
			Obj_Delete(def2[0]);
			Obj_Delete(def2[1]);
			break;
		}
		
		yield;
	}
}