

task Cdraw//自機中心の陣のタスク
{
let angle=0;
let Malpha=0;
loop
{
  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		ObjEffect_SetTexture(obj, imgBorder);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		//ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -32, -32);
		ObjEffect_SetVertexXY(obj, 1,  32, -32);
		ObjEffect_SetVertexXY(obj, 2,  32,  32);
		ObjEffect_SetVertexXY(obj, 3, -32,  32);
		
		ObjEffect_SetVertexUV(obj, 0,  64,  0);
		ObjEffect_SetVertexUV(obj, 1,  128, 0);
		ObjEffect_SetVertexUV(obj, 2, 128, 64);
		ObjEffect_SetVertexUV(obj, 3, 64, 64);

		ObjEffect_SetVertexColor(obj,0,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,1,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,2,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,3,Malpha,255,255,255);

		ObjEffect_SetLayer(obj, 2);
		ObjEffect_SetAngle(obj, 0,0,angle);
		angle+=1.5;
		if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
			if(Malpha<150)
			{
				Malpha+=10;
			}
		}
		else
		{
			if(Malpha>0)
			{
				Malpha-=10;
			}
		}
		yield;
		Obj_Delete(obj);
}
}


task atari//当り判定の描画
{
  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		ObjEffect_SetTexture(obj, imgBorder);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		//ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -5, -5);
		ObjEffect_SetVertexXY(obj, 1,  5, -5);
		ObjEffect_SetVertexXY(obj, 2,  5,  5);
		ObjEffect_SetVertexXY(obj, 3, -5,  5);
		
		ObjEffect_SetVertexUV(obj, 0,  27,  27);
		ObjEffect_SetVertexUV(obj, 1,  37, 27);
		ObjEffect_SetVertexUV(obj, 2, 37,  37);
		ObjEffect_SetVertexUV(obj, 3, 27, 37);
		if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)
		{
		ObjEffect_SetVertexColor(obj,0,250,255,255,255);
		ObjEffect_SetVertexColor(obj,1,250,255,255,255);
		ObjEffect_SetVertexColor(obj,2,250,255,255,255);
		ObjEffect_SetVertexColor(obj,3,250,255,255,255);
		}
		else
		{
		ObjEffect_SetVertexColor(obj,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj,1,0,255,255,255);
		ObjEffect_SetVertexColor(obj,2,0,255,255,255);
		ObjEffect_SetVertexColor(obj,3,0,255,255,255);
		}
		
		ObjEffect_SetLayer(obj, 3);
		yield;
		Obj_Delete(obj);
}