//Ž©‹@•\Ž¦
task TImage
{
	let path = IMG_PLAYER;
	ObjPrim_SetTexture(objPlayer, path);
	Obj_SetRenderPriorityI(objPlayer,44);
	//ObjRender_SetBlendType(objPlayer, BLEND_ADD_RGB);
	let FrameCount=0;
	let RectX=[];
	let RectY=[];
	let InvincibleFrame=0;
	loop
	{
		if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || SpellMove==1)
		{
			RectY=[96,144];
			FrameCount=5;
		}
		else if(GetVirtualKeyState(VK_RIGHT) == KEY_HOLD || SpellMove>1)
		{
			RectY=[96,144];
			if(FrameCount==0){FrameCount=20;}
			else if(FrameCount==6)
			{
				FrameCount=10;
			}
			else if(FrameCount==11)
			{
				FrameCount=15;
			}
			else if(FrameCount==16)
			{
				FrameCount=20;
			}
		}
		else if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || SpellMove==-1)
		{
			RectY=[48,96];
			FrameCount=5;
		}
		else if(GetVirtualKeyState(VK_LEFT) == KEY_HOLD || SpellMove<-1)
		{
			RectY=[48,96];
			if(FrameCount==0){FrameCount=20;}
			else if(FrameCount==6)
			{
				FrameCount=10;
			}
			else if(FrameCount==11)
			{
				FrameCount=15;
			}
			else if(FrameCount==16)
			{
				FrameCount=20;
			}
		}
		else
		{
			RectY=[0,48];
		}

		if(RebirthFlag)
		{
			RectY=[0,48];
		}

		ObjSprite2D_SetDestCenter(objPlayer);
 		if(GetPlayerState==STATE_NORMAL)
		{
				ObjRender_SetAlpha(objPlayer,255);
				ObjRender_SetColor(objPlayer,255,255,255);
		}

		if(GetPlayerInvincibilityFrame>0 || GetPlayerState==STATE_HIT || InvincibleCount>0)
		{
		if(InvincibleFrame%3==2)
		{
			ObjRender_SetColor(objPlayer,0,0,255);
		}
		}

		RectX=[0+32*floor(FrameCount/5),32+32*floor(FrameCount/5)];
		ObjSprite2D_SetSourceRect(objPlayer, RectX[0], RectY[0], RectX[1], RectY[1]);
		FrameCount++;
		if(FrameCount>=5*8){FrameCount=0;}
		InvincibleFrame+=1;
		yield;
	}
}