let objMarker;
let objMarkerZ;
let imgMarker = GetCurrentScriptDirectory~"./img/EnemyMarker.png";

task EnemyMarker(boss){
	objMarker = CreateEffectObject(ObjMove_GetX(boss)+42*(4/5),GetStgFrameHeight+32,imgMarker,"ALPHA",0,0,42,16);

	while(!Obj_IsDeleted(boss))
	{
	        ObjRender_SetPosition(objMarker,ObjMove_GetX(boss)+42*(4/5),GetStgFrameHeight+32*(4/5),0);
	        Obj_SetRenderPriorityI(objMarker,100);
		yield;
	}
        Obj_Delete(objMarker);
}

task EnemyMarkerZ(boss){
	objMarkerZ = CreateEffectObject(ObjMove_GetX(boss)+42*(4/5),GetStgFrameHeight+32,imgMarker,"ALPHA",0,0,42,16);

	while(!Obj_IsDeleted(boss))
	{
	        ObjRender_SetPosition(objMarkerZ,ObjMove_GetX(boss)+42*(4/5),GetStgFrameHeight+32*(4/5),0);
	        Obj_SetRenderPriorityI(objMarkerZ,100);
		yield;
	}
        Obj_Delete(objMarkerZ);
}

function CreateEffectObject(px,py,img,blendtype,left,top,right,bottom){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	LoadTexture(img);
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,left,top,right,bottom);
	ObjSprite2D_SetDestCenter(obj);
	if(blendtype=="ALPHA"){
	ObjRender_SetBlendType(obj,BLEND_ALPHA);
	}
	if(blendtype=="RGB"){
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	}
	if(blendtype=="ARGB"){
	ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
	}
	ObjRender_SetPosition(obj,px,py,0);
	ObjMove_SetPosition(obj,px,py,);
	return obj;
}