
//=======================================================================
//　エネミーマーカーを表示する関数集です。
//　このファイルをinclude_functionで取り込むか、
//　必要な部分をコピペして使用してください。
//=======================================================================

//=======================================================================
// ■ 画像へのパス 構成が違う場合は要変更
//-----------------------------------------------------------------------
let imgmarker = GetCurrentScriptDirectory() ~ "../img/Marker.png";
//=======================================================================

//=======================================================================
// ■ 点滅開始のライフ（設定した値を敵ライフが下回ると点滅が開始されます）
//-----------------------------------------------------------------------
let MARKER_FLICKER_LIFE = 1000;
//=======================================================================

//-----------------------------------------------------------------------
// ■ 点滅開始のライフ設定関数
//-----------------------------------------------------------------------
function SetFlickerLife(set_f_life) {

	MARKER_FLICKER_LIFE = set_f_life;

}

//-----------------------------------------------------------------------
// ■ 点滅開始のライフ取得関数
//-----------------------------------------------------------------------
function GetFlickerLife {

	return(MARKER_FLICKER_LIFE);

}

//-----------------------------------------------------------------------
// ■ エネミーマーカー [th11]
//-----------------------------------------------------------------------
task EnemyMarker01(Enemy) {

	let marker	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let m_wait	= 20;
	let alpha	= 255;

	let MinX	= GetStgFrameLeft();
	let MinY	= GetStgFrameTop();
	let WidX	= GetStgFrameWidth();
	let WidY	= GetStgFrameHeight();

	ObjRender_SetX(marker,ObjMove_GetX(Enemy));
	ObjRender_SetY(marker,MinY+WidY+8);
	ObjPrim_SetTexture(marker,imgmarker);
	ObjRender_SetBlendType(marker,BLEND_ALPHA);
	Obj_SetRenderPriorityI(marker,90);
	ObjPrim_SetPrimitiveType(marker,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(marker,1.00,1.00,1.00);
	ObjPrim_SetVertexCount(marker,4);
	ObjPrim_SetVertexPosition(marker,0,-24,-8,0);
	ObjPrim_SetVertexPosition(marker,1,-24, 8,0);
	ObjPrim_SetVertexPosition(marker,2, 24,-8,0);
	ObjPrim_SetVertexPosition(marker,3, 24, 8,0);
	ObjPrim_SetVertexUVT(marker,0,  0, 0);
	ObjPrim_SetVertexUVT(marker,1,  0,16);
	ObjPrim_SetVertexUVT(marker,2, 48, 0);
	ObjPrim_SetVertexUVT(marker,3, 48,16);
	ObjPrim_SetVertexColor(marker,0,255,255,255);
	ObjPrim_SetVertexColor(marker,1,255,255,255);
	ObjPrim_SetVertexColor(marker,2,255,255,255);
	ObjPrim_SetVertexColor(marker,3,255,255,255);

	while(ObjEnemy_GetInfo(Enemy,INFO_LIFE)>MARKER_FLICKER_LIFE) {
		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,255,255,255);
		ObjPrim_SetVertexColor(marker,1,255,255,255);
		ObjPrim_SetVertexColor(marker,2,255,255,255);
		ObjPrim_SetVertexColor(marker,3,255,255,255);
		yield;
	}
	while(!Obj_IsDeleted(Enemy)) {
		m_wait = 3+17*(ObjEnemy_GetInfo(Enemy,INFO_LIFE)/MARKER_FLICKER_LIFE);
		loop(m_wait) {
			alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

			ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
			if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

			ObjPrim_SetVertexAlpha(marker,0,alpha);
			ObjPrim_SetVertexAlpha(marker,1,alpha);
			ObjPrim_SetVertexAlpha(marker,2,alpha);
			ObjPrim_SetVertexAlpha(marker,3,alpha);
			ObjPrim_SetVertexColor(marker,0,255,255,255);
			ObjPrim_SetVertexColor(marker,1,255,255,255);
			ObjPrim_SetVertexColor(marker,2,255,255,255);
			ObjPrim_SetVertexColor(marker,3,255,255,255);
			yield;
		}
		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;
		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,0,0,0);
		ObjPrim_SetVertexColor(marker,1,0,0,0);
		ObjPrim_SetVertexColor(marker,2,0,0,0);
		ObjPrim_SetVertexColor(marker,3,0,0,0);
		yield;
	}
	Obj_Delete(marker);
}

//-----------------------------------------------------------------------
// ■ エネミーマーカー [th12]
//-----------------------------------------------------------------------
task EnemyMarker02(Enemy) {

	let marker	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let m_wait	= 20;
	let alpha	= 255;

	let MinX	= GetStgFrameLeft();
	let MinY	= GetStgFrameTop();
	let WidX	= GetStgFrameWidth();
	let WidY	= GetStgFrameHeight();

	ObjRender_SetX(marker,ObjMove_GetX(Enemy));
	ObjRender_SetY(marker,MinY+WidY+8);
	ObjPrim_SetTexture(marker,imgmarker);
	ObjRender_SetBlendType(marker,BLEND_ALPHA);
	Obj_SetRenderPriorityI(marker,90);
	ObjPrim_SetPrimitiveType(marker,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(marker,1.00,1.00,1.00);
	ObjPrim_SetVertexCount(marker,4);
	ObjPrim_SetVertexPosition(marker,0,-24,-8,0);
	ObjPrim_SetVertexPosition(marker,1,-24, 8,0);
	ObjPrim_SetVertexPosition(marker,2, 24,-8,0);
	ObjPrim_SetVertexPosition(marker,3, 24, 8,0);
	ObjPrim_SetVertexUVT(marker,0, 48, 0);
	ObjPrim_SetVertexUVT(marker,1, 48,16);
	ObjPrim_SetVertexUVT(marker,2, 96, 0);
	ObjPrim_SetVertexUVT(marker,3, 96,16);
	ObjPrim_SetVertexColor(marker,0,255,255,255);
	ObjPrim_SetVertexColor(marker,1,255,255,255);
	ObjPrim_SetVertexColor(marker,2,255,255,255);
	ObjPrim_SetVertexColor(marker,3,255,255,255);

	while(ObjEnemy_GetInfo(Enemy,INFO_LIFE)>MARKER_FLICKER_LIFE) {
		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,255,255,255);
		ObjPrim_SetVertexColor(marker,1,255,255,255);
		ObjPrim_SetVertexColor(marker,2,255,255,255);
		ObjPrim_SetVertexColor(marker,3,255,255,255);
		yield;
	}
	while(!Obj_IsDeleted(Enemy)) {
		m_wait = 3+17*(ObjEnemy_GetInfo(Enemy,INFO_LIFE)/MARKER_FLICKER_LIFE);
		loop(m_wait) {
			alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

			ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
			if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

			ObjPrim_SetVertexAlpha(marker,0,alpha);
			ObjPrim_SetVertexAlpha(marker,1,alpha);
			ObjPrim_SetVertexAlpha(marker,2,alpha);
			ObjPrim_SetVertexAlpha(marker,3,alpha);
			ObjPrim_SetVertexColor(marker,0,255,255,255);
			ObjPrim_SetVertexColor(marker,1,255,255,255);
			ObjPrim_SetVertexColor(marker,2,255,255,255);
			ObjPrim_SetVertexColor(marker,3,255,255,255);
			yield;
		}
		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;
		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,0,0,0);
		ObjPrim_SetVertexColor(marker,1,0,0,0);
		ObjPrim_SetVertexColor(marker,2,0,0,0);
		ObjPrim_SetVertexColor(marker,3,0,0,0);
		yield;
	}
	Obj_Delete(marker);
}

//-----------------------------------------------------------------------
// ■ エネミーマーカー [th10]
//-----------------------------------------------------------------------
task EnemyMarker03(Enemy) {

	let marker	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let m_wait	= 20;
	let alpha	= 255;

	let MinX	= GetStgFrameLeft();
	let MinY	= GetStgFrameTop();
	let WidX	= GetStgFrameWidth();
	let WidY	= GetStgFrameHeight();

	ObjRender_SetX(marker,ObjMove_GetX(Enemy));
	ObjRender_SetY(marker,MinY+WidY+8);
	ObjPrim_SetTexture(marker,imgmarker);
	ObjRender_SetBlendType(marker,BLEND_ALPHA);
	Obj_SetRenderPriorityI(marker,90);
	ObjPrim_SetPrimitiveType(marker,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(marker,1.00,1.00,1.00);
	ObjPrim_SetVertexCount(marker,4);
	ObjPrim_SetVertexPosition(marker,0,-24,-8,0);
	ObjPrim_SetVertexPosition(marker,1,-24, 8,0);
	ObjPrim_SetVertexPosition(marker,2, 24,-8,0);
	ObjPrim_SetVertexPosition(marker,3, 24, 8,0);
	ObjPrim_SetVertexUVT(marker,0,  0,16);
	ObjPrim_SetVertexUVT(marker,1,  0,32);
	ObjPrim_SetVertexUVT(marker,2, 48,16);
	ObjPrim_SetVertexUVT(marker,3, 48,32);
	ObjPrim_SetVertexColor(marker,0,255,255,255);
	ObjPrim_SetVertexColor(marker,1,255,255,255);
	ObjPrim_SetVertexColor(marker,2,255,255,255);
	ObjPrim_SetVertexColor(marker,3,255,255,255);

	while(ObjEnemy_GetInfo(Enemy,INFO_LIFE)>MARKER_FLICKER_LIFE) {
		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,255,255,255);
		ObjPrim_SetVertexColor(marker,1,255,255,255);
		ObjPrim_SetVertexColor(marker,2,255,255,255);
		ObjPrim_SetVertexColor(marker,3,255,255,255);
		yield;
	}
	while(!Obj_IsDeleted(Enemy)) {
		m_wait = 3+17*(ObjEnemy_GetInfo(Enemy,INFO_LIFE)/MARKER_FLICKER_LIFE);
		loop(m_wait) {
			alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

			ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
			if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

			ObjPrim_SetVertexAlpha(marker,0,alpha);
			ObjPrim_SetVertexAlpha(marker,1,alpha);
			ObjPrim_SetVertexAlpha(marker,2,alpha);
			ObjPrim_SetVertexAlpha(marker,3,alpha);
			ObjPrim_SetVertexColor(marker,0,255,255,255);
			ObjPrim_SetVertexColor(marker,1,255,255,255);
			ObjPrim_SetVertexColor(marker,2,255,255,255);
			ObjPrim_SetVertexColor(marker,3,255,255,255);
			yield;
		}
		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;
		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,0,0,0);
		ObjPrim_SetVertexColor(marker,1,0,0,0);
		ObjPrim_SetVertexColor(marker,2,0,0,0);
		ObjPrim_SetVertexColor(marker,3,0,0,0);
		yield;
	}
	Obj_Delete(marker);
}

//-----------------------------------------------------------------------
// ■ エネミーマーカー [th13]
//-----------------------------------------------------------------------
task EnemyMarker04(Enemy) {

	let marker	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let m_wait	= 20;
	let alpha	= 255;

	let MinX	= GetStgFrameLeft();
	let MinY	= GetStgFrameTop();
	let WidX	= GetStgFrameWidth();
	let WidY	= GetStgFrameHeight();

	ObjRender_SetX(marker,ObjMove_GetX(Enemy));
	ObjRender_SetY(marker,MinY+WidY+8);
	ObjPrim_SetTexture(marker,imgmarker);
	ObjRender_SetBlendType(marker,BLEND_ALPHA);
	Obj_SetRenderPriorityI(marker,90);
	ObjPrim_SetPrimitiveType(marker,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(marker,1.00,1.00,1.00);
	ObjPrim_SetVertexCount(marker,4);
	ObjPrim_SetVertexPosition(marker,0,-24,-8,0);
	ObjPrim_SetVertexPosition(marker,1,-24, 8,0);
	ObjPrim_SetVertexPosition(marker,2, 24,-8,0);
	ObjPrim_SetVertexPosition(marker,3, 24, 8,0);
	ObjPrim_SetVertexUVT(marker,0, 48,16);
	ObjPrim_SetVertexUVT(marker,1, 48,32);
	ObjPrim_SetVertexUVT(marker,2, 96,16);
	ObjPrim_SetVertexUVT(marker,3, 96,32);
	ObjPrim_SetVertexColor(marker,0,255,255,255);
	ObjPrim_SetVertexColor(marker,1,255,255,255);
	ObjPrim_SetVertexColor(marker,2,255,255,255);
	ObjPrim_SetVertexColor(marker,3,255,255,255);

	while(ObjEnemy_GetInfo(Enemy,INFO_LIFE)>MARKER_FLICKER_LIFE) {
		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,255,255,255);
		ObjPrim_SetVertexColor(marker,1,255,255,255);
		ObjPrim_SetVertexColor(marker,2,255,255,255);
		ObjPrim_SetVertexColor(marker,3,255,255,255);
		yield;
	}
	while(!Obj_IsDeleted(Enemy)) {
		m_wait = 3+17*(ObjEnemy_GetInfo(Enemy,INFO_LIFE)/MARKER_FLICKER_LIFE);
		loop(m_wait) {
			alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

			ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
			if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

			ObjPrim_SetVertexAlpha(marker,0,alpha);
			ObjPrim_SetVertexAlpha(marker,1,alpha);
			ObjPrim_SetVertexAlpha(marker,2,alpha);
			ObjPrim_SetVertexAlpha(marker,3,alpha);
			ObjPrim_SetVertexColor(marker,0,255,255,255);
			ObjPrim_SetVertexColor(marker,1,255,255,255);
			ObjPrim_SetVertexColor(marker,2,255,255,255);
			ObjPrim_SetVertexColor(marker,3,255,255,255);
			yield;
		}
		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;
		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,0,0,0);
		ObjPrim_SetVertexColor(marker,1,0,0,0);
		ObjPrim_SetVertexColor(marker,2,0,0,0);
		ObjPrim_SetVertexColor(marker,3,0,0,0);
		yield;
	}
	Obj_Delete(marker);
}

//-----------------------------------------------------------------------
// ■ エネミーマーカー [th09]
//-----------------------------------------------------------------------
task EnemyMarker05(Enemy) {

	let marker	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let m_wait	= 20;
	let alpha	= 255;

	let MinX	= GetStgFrameLeft();
	let MinY	= GetStgFrameTop();
	let WidX	= GetStgFrameWidth();
	let WidY	= GetStgFrameHeight();

	ObjRender_SetX(marker,ObjMove_GetX(Enemy));
	ObjRender_SetY(marker,MinY+WidY+8);
	ObjPrim_SetTexture(marker,imgmarker);
	ObjRender_SetBlendType(marker,BLEND_ALPHA);
	Obj_SetRenderPriorityI(marker,90);
	ObjPrim_SetPrimitiveType(marker,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(marker,1.00,1.00,1.00);
	ObjPrim_SetVertexCount(marker,4);
	ObjPrim_SetVertexPosition(marker,0,-24,-8,0);
	ObjPrim_SetVertexPosition(marker,1,-24, 8,0);
	ObjPrim_SetVertexPosition(marker,2, 24,-8,0);
	ObjPrim_SetVertexPosition(marker,3, 24, 8,0);
	ObjPrim_SetVertexUVT(marker,0,  0,32);
	ObjPrim_SetVertexUVT(marker,1,  0,48);
	ObjPrim_SetVertexUVT(marker,2, 48,32);
	ObjPrim_SetVertexUVT(marker,3, 48,48);
	ObjPrim_SetVertexColor(marker,0,255,255,255);
	ObjPrim_SetVertexColor(marker,1,255,255,255);
	ObjPrim_SetVertexColor(marker,2,255,255,255);
	ObjPrim_SetVertexColor(marker,3,255,255,255);

	while(ObjEnemy_GetInfo(Enemy,INFO_LIFE)>MARKER_FLICKER_LIFE) {
		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,255,255,255);
		ObjPrim_SetVertexColor(marker,1,255,255,255);
		ObjPrim_SetVertexColor(marker,2,255,255,255);
		ObjPrim_SetVertexColor(marker,3,255,255,255);
		yield;
	}
	while(!Obj_IsDeleted(Enemy)) {
		m_wait = 3+17*(ObjEnemy_GetInfo(Enemy,INFO_LIFE)/MARKER_FLICKER_LIFE);
		loop(m_wait) {
			alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

			ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
			if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

			ObjPrim_SetVertexAlpha(marker,0,alpha);
			ObjPrim_SetVertexAlpha(marker,1,alpha);
			ObjPrim_SetVertexAlpha(marker,2,alpha);
			ObjPrim_SetVertexAlpha(marker,3,alpha);
			ObjPrim_SetVertexColor(marker,0,255,255,255);
			ObjPrim_SetVertexColor(marker,1,255,255,255);
			ObjPrim_SetVertexColor(marker,2,255,255,255);
			ObjPrim_SetVertexColor(marker,3,255,255,255);
			yield;
		}
		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;
		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,0,0,0);
		ObjPrim_SetVertexColor(marker,1,0,0,0);
		ObjPrim_SetVertexColor(marker,2,0,0,0);
		ObjPrim_SetVertexColor(marker,3,0,0,0);
		yield;
	}
	Obj_Delete(marker);
}

//-----------------------------------------------------------------------
// ■ エネミーマーカー [th12] [色変更可]
//-----------------------------------------------------------------------
task EnemyMarkerEx(Enemy,R,G,B) {

	let marker	= ObjPrim_Create(OBJ_PRIMITIVE_2D);
	let m_wait	= 20;
	let alpha	= 255;

	let MinX	= GetStgFrameLeft();
	let MinY	= GetStgFrameTop();
	let WidX	= GetStgFrameWidth();
	let WidY	= GetStgFrameHeight();

	ObjRender_SetX(marker,ObjMove_GetX(Enemy));
	ObjRender_SetY(marker,MinY+WidY+8);
	ObjPrim_SetTexture(marker,imgmarker);
	ObjRender_SetBlendType(marker,BLEND_ALPHA);
	Obj_SetRenderPriorityI(marker,90);
	ObjPrim_SetPrimitiveType(marker,PRIMITIVE_TRIANGLESTRIP);
	ObjRender_SetScaleXYZ(marker,1.00,1.00,1.00);
	ObjPrim_SetVertexCount(marker,4);
	ObjPrim_SetVertexPosition(marker,0,-24,-8,0);
	ObjPrim_SetVertexPosition(marker,1,-24, 8,0);
	ObjPrim_SetVertexPosition(marker,2, 24,-8,0);
	ObjPrim_SetVertexPosition(marker,3, 24, 8,0);
	ObjPrim_SetVertexUVT(marker,0, 48,32);
	ObjPrim_SetVertexUVT(marker,1, 48,48);
	ObjPrim_SetVertexUVT(marker,2, 96,32);
	ObjPrim_SetVertexUVT(marker,3, 96,48);
	ObjPrim_SetVertexColor(marker,0,R,G,B);
	ObjPrim_SetVertexColor(marker,1,R,G,B);
	ObjPrim_SetVertexColor(marker,2,R,G,B);
	ObjPrim_SetVertexColor(marker,3,R,G,B);

	while(ObjEnemy_GetInfo(Enemy,INFO_LIFE)>MARKER_FLICKER_LIFE) {
		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,R,G,B);
		ObjPrim_SetVertexColor(marker,1,R,G,B);
		ObjPrim_SetVertexColor(marker,2,R,G,B);
		ObjPrim_SetVertexColor(marker,3,R,G,B);
		yield;
	}
	while(!Obj_IsDeleted(Enemy)) {
		m_wait = 3+17*(ObjEnemy_GetInfo(Enemy,INFO_LIFE)/MARKER_FLICKER_LIFE);
		loop(m_wait) {
			alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;

			ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
			if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

			ObjPrim_SetVertexAlpha(marker,0,alpha);
			ObjPrim_SetVertexAlpha(marker,1,alpha);
			ObjPrim_SetVertexAlpha(marker,2,alpha);
			ObjPrim_SetVertexAlpha(marker,3,alpha);
			ObjPrim_SetVertexColor(marker,0,R,G,B);
			ObjPrim_SetVertexColor(marker,1,R,G,B);
			ObjPrim_SetVertexColor(marker,2,R,G,B);
			ObjPrim_SetVertexColor(marker,3,R,G,B);
			yield;
		}
		ObjRender_SetX(marker,ObjMove_GetX(Enemy)+MinX);
		if(ObjMove_GetX(Enemy)<0 || ObjMove_GetX(Enemy)>WidX) { ObjRender_SetX(marker,-100); }

		alpha = 144+absolute(ObjMove_GetX(Enemy)-GetPlayerX)*2;
		ObjPrim_SetVertexAlpha(marker,0,alpha);
		ObjPrim_SetVertexAlpha(marker,1,alpha);
		ObjPrim_SetVertexAlpha(marker,2,alpha);
		ObjPrim_SetVertexAlpha(marker,3,alpha);
		ObjPrim_SetVertexColor(marker,0,0,0,0);
		ObjPrim_SetVertexColor(marker,1,0,0,0);
		ObjPrim_SetVertexColor(marker,2,0,0,0);
		ObjPrim_SetVertexColor(marker,3,0,0,0);
		yield;
	}
	Obj_Delete(marker);
}