task N_Load//なうろーでぃんぐ
{
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj,false);
	ObjEffect_SetTexture(obj,LoadingG);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	ObjEffect_SetVertexXY(obj,0,-320,-240);
	ObjEffect_SetVertexXY(obj,1, 320,-240);
	ObjEffect_SetVertexXY(obj,2,-320, 240);
	ObjEffect_SetVertexXY(obj,3, 320, 240);
	ObjEffect_SetVertexColor(obj,0,255,255,255,255);
	ObjEffect_SetVertexColor(obj,1,255,255,255,255);
	ObjEffect_SetVertexColor(obj,2,255,255,255,255);
	ObjEffect_SetVertexColor(obj,3,255,255,255,255);
	ObjEffect_SetVertexUV(obj,0,  0,  0);
	ObjEffect_SetVertexUV(obj,1,640,  0);
	ObjEffect_SetVertexUV(obj,2,  0,480);
	ObjEffect_SetVertexUV(obj,3,640,480);
	ObjEffect_SetLayer(obj,8);
	Obj_SetPosition(obj,cx+95,cy);
	loop(30){yield;}
	Obj_Delete(obj);

}

task S_Character
{
	yield;
	Base;
	High_Score;
	Score;
	Score_Up;
	PB_Ster;//残機とボム数
	PowerTask;
	GrazeTask;
	PointTask;
	IceTask;
	AddSistemTask;//最高点
	CTask;
	CUpTask;
}

task Base{//スコアやプレイヤーなどの部分
	let i=0;
	let Y=cy-200;
	Base3;
	loop(2){
		Base2(i,Y);
		i++;
		Y+=25;
	}
	Y+=20;
	loop(2){
		Base2(i,Y);
		i++;
		Y+=25;
	}
	Y+=20;
	loop(4){
		Base2(i,Y);
		i++;
		Y+=25;
	}
}


task Base3(){//枠
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj,false);
	ObjEffect_SetTexture(obj,imgBase);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	ObjEffect_SetVertexXY(obj,0,-320,-240);
	ObjEffect_SetVertexXY(obj,1, 320,-240);
	ObjEffect_SetVertexXY(obj,2,-320, 240);
	ObjEffect_SetVertexXY(obj,3, 320, 240);
	ObjEffect_SetVertexColor(obj,0,255,255,255,255);
	ObjEffect_SetVertexColor(obj,1,255,255,255,255);
	ObjEffect_SetVertexColor(obj,2,255,255,255,255);
	ObjEffect_SetVertexColor(obj,3,255,255,255,255);
	ObjEffect_SetVertexUV(obj,0,  0,  0);
	ObjEffect_SetVertexUV(obj,1,640,  0);
	ObjEffect_SetVertexUV(obj,2,  0,480);
	ObjEffect_SetVertexUV(obj,3,640,480);
	ObjEffect_SetLayer(obj,8);

	Obj_SetPosition(obj,cx+95,cy);
}

task Base2(i,Y){//スコアやプレイヤーなどの文字表示
	let PY=i*32;
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj,false);
	ObjEffect_SetTexture(obj,imgScore);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	ObjEffect_SetVertexXY(obj,0,-64,-16);
	ObjEffect_SetVertexXY(obj,1, 64,-16);
	ObjEffect_SetVertexXY(obj,2,-64, 16);
	ObjEffect_SetVertexXY(obj,3, 64, 16);
	ObjEffect_SetVertexColor(obj,0,255,0,0,0);
	ObjEffect_SetVertexColor(obj,1,255,0,0,0);
	ObjEffect_SetVertexColor(obj,2,255,0,0,0);
	ObjEffect_SetVertexColor(obj,3,255,0,0,0);
	ObjEffect_SetVertexUV(obj,0,  0, 0+PY);
	ObjEffect_SetVertexUV(obj,1,128, 0+PY);
	ObjEffect_SetVertexUV(obj,2,  0,32+PY);
	ObjEffect_SetVertexUV(obj,3,128,32+PY);
	ObjEffect_SetLayer(obj,8);
	Obj_SetPosition(obj,cx+258,Y);
}

task High_Score{//ハイスコア
	let S0 = 0;
	let S1 = 0;
	let S2 = 0;
	let S3 = 0;
	let S4 = 0;
	let S5 = 0;
	let S6 = 0;
	let S7 = 0;
	let S8 = 0;
	let S9 = 0;

	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,8);
	Obj_SetPosition(obj0,cx+295,cy-200);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,8);
	Obj_SetPosition(obj1,cx+295+11,cy-200);

	let obj2=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj2,false);
	ObjEffect_SetTexture(obj2,imgScore);
	ObjEffect_SetPrimitiveType(obj2,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj2,4);
	ObjEffect_SetLayer(obj2,8);
	Obj_SetPosition(obj2,cx+295+22,cy-200);

	let obj3=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj3,false);
	ObjEffect_SetTexture(obj3,imgScore);
	ObjEffect_SetPrimitiveType(obj3,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj3,4);
	ObjEffect_SetLayer(obj3,8);
	Obj_SetPosition(obj3,cx+295+33,cy-200);

	let obj4=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj4,false);
	ObjEffect_SetTexture(obj4,imgScore);
	ObjEffect_SetPrimitiveType(obj4,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj4,4);
	ObjEffect_SetLayer(obj4,8);
	Obj_SetPosition(obj4,cx+295+44,cy-200);

	let obj5=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj5,false);
	ObjEffect_SetTexture(obj5,imgScore);
	ObjEffect_SetPrimitiveType(obj5,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj5,4);
	ObjEffect_SetLayer(obj5,8);
	Obj_SetPosition(obj5,cx+295+55,cy-200);

	let obj6=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj6,false);
	ObjEffect_SetTexture(obj6,imgScore);
	ObjEffect_SetPrimitiveType(obj6,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj6,4);
	ObjEffect_SetLayer(obj6,8);
	Obj_SetPosition(obj6,cx+295+66,cy-200);

	let obj7=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj7,false);
	ObjEffect_SetTexture(obj7,imgScore);
	ObjEffect_SetPrimitiveType(obj7,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj7,4);
	ObjEffect_SetLayer(obj7,8);
	Obj_SetPosition(obj7,cx+295+77,cy-200);

	let obj8=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj8,false);
	ObjEffect_SetTexture(obj8,imgScore);
	ObjEffect_SetPrimitiveType(obj8,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj8,4);
	ObjEffect_SetLayer(obj8,8);
	Obj_SetPosition(obj8,cx+295+88,cy-200);

	let obj9=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj9,false);
	ObjEffect_SetTexture(obj9,imgScore);
	ObjEffect_SetPrimitiveType(obj9,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj9,4);
	ObjEffect_SetLayer(obj9,8);
	Obj_SetPosition(obj9,cx+295+99,cy-200);
	let PX1 = [ -8,  8, -8,  8];
	let PY1 = [-16,-16, 16, 16];
	ascent( let i in 0..4){
		ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj2,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj3,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj4,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj5,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj6,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj7,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj8,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj9,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexColor(obj0,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj1,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj2,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj3,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj4,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj5,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj6,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj7,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj8,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj9,i,255,0,0,0);
	}
	let X=[144,128,144,160,176,192,208,224,240,128];
	let Y=[ 32,  0,  0,  0,  0,  0,  0,  0,  0, 32];
	let PX2 = [  0, 16,  0, 16];
	let PY2 = [  0,  0, 32, 32];
	let GS = 0;
	let GS2 = 0;
	if(GetCommonData("AnotherMode") == 0){//hard
		if(GetPlayerScriptName == "cirnoA.txt"){
			GS = GetCommonDataDefault("H_HighScoreA",0);//凍
			GS2 = GetCommonDataDefault("H_HighScoreA_2",0);
		}
		if(GetPlayerScriptName == "cirnoB.txt"){
			GS = GetCommonDataDefault("H_HighScoreB",0);//凍
			GS2 = GetCommonDataDefault("H_HighScoreB_2",0);
		}
	}
	if(GetCommonData("AnotherMode") == 1){//easy
		if(GetPlayerScriptName == "cirnoA.txt"){
			GS = GetCommonDataDefault("E_HighScoreA",0);//凍
			GS2 = GetCommonDataDefault("E_HighScoreA_2",0);
		}
		if(GetPlayerScriptName == "cirnoB.txt"){
			GS = GetCommonDataDefault("E_HighScoreB",0);//凍
			GS2 = GetCommonDataDefault("E_HighScoreB_2",0);
		}
	}
	S0 = truncate(GS2/1000)-truncate(GS2/10000)*10;
	S1 = truncate(GS2/100)- truncate(GS2/1000)*10;
	S2 = truncate(GS2/10)-  truncate(GS2/100)*10;
	S3 = truncate(GS2)-     truncate(GS2/10)*10;
	S4 = truncate(GS/100000)-    truncate(GS/1000000)*10;
	S5 = truncate(GS/10000)-     truncate(GS/100000)*10;
	S6 = truncate(GS/1000)-      truncate(GS/10000)*10;
	S7 = truncate(GS/100)-       truncate(GS/1000)*10;
	S8 = truncate(GS/10)-        truncate(GS/100)*10;
	S9 = truncate(GS/1)-         truncate(GS/10)*10;

	ascent( let i in 0..4){
		ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,Y[S0]+PY2[i]);
		ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,Y[S1]+PY2[i]);
		ObjEffect_SetVertexUV(obj2,i,X[S2]+PX2[i] ,Y[S2]+PY2[i]);
		ObjEffect_SetVertexUV(obj3,i,X[S3]+PX2[i] ,Y[S3]+PY2[i]);
		ObjEffect_SetVertexUV(obj4,i,X[S4]+PX2[i] ,Y[S4]+PY2[i]);
		ObjEffect_SetVertexUV(obj5,i,X[S5]+PX2[i] ,Y[S5]+PY2[i]);
		ObjEffect_SetVertexUV(obj6,i,X[S6]+PX2[i] ,Y[S6]+PY2[i]);
		ObjEffect_SetVertexUV(obj7,i,X[S7]+PX2[i] ,Y[S7]+PY2[i]);
		ObjEffect_SetVertexUV(obj8,i,X[S8]+PX2[i] ,Y[S8]+PY2[i]);
		ObjEffect_SetVertexUV(obj9,i,X[S9]+PX2[i] ,Y[S9]+PY2[i]);
	}
}


task Score{//自作スコア
	let S0 = 0;
	let S1 = 0;
	let S2 = 0;
	let S3 = 0;
	let S4 = 0;
	let S5 = 0;
	let S6 = 0;
	let S7 = 0;
	let S8 = 0;
	let S9 = 0;

	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,8);
	Obj_SetPosition(obj0,cx+295,cy-175);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,8);
	Obj_SetPosition(obj1,cx+295+11,cy-175);

	let obj2=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj2,false);
	ObjEffect_SetTexture(obj2,imgScore);
	ObjEffect_SetPrimitiveType(obj2,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj2,4);
	ObjEffect_SetLayer(obj2,8);
	Obj_SetPosition(obj2,cx+295+22,cy-175);

	let obj3=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj3,false);
	ObjEffect_SetTexture(obj3,imgScore);
	ObjEffect_SetPrimitiveType(obj3,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj3,4);
	ObjEffect_SetLayer(obj3,8);
	Obj_SetPosition(obj3,cx+295+33,cy-175);

	let obj4=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj4,false);
	ObjEffect_SetTexture(obj4,imgScore);
	ObjEffect_SetPrimitiveType(obj4,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj4,4);
	ObjEffect_SetLayer(obj4,8);
	Obj_SetPosition(obj4,cx+295+44,cy-175);

	let obj5=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj5,false);
	ObjEffect_SetTexture(obj5,imgScore);
	ObjEffect_SetPrimitiveType(obj5,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj5,4);
	ObjEffect_SetLayer(obj5,8);
	Obj_SetPosition(obj5,cx+295+55,cy-175);

	let obj6=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj6,false);
	ObjEffect_SetTexture(obj6,imgScore);
	ObjEffect_SetPrimitiveType(obj6,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj6,4);
	ObjEffect_SetLayer(obj6,8);
	Obj_SetPosition(obj6,cx+295+66,cy-175);

	let obj7=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj7,false);
	ObjEffect_SetTexture(obj7,imgScore);
	ObjEffect_SetPrimitiveType(obj7,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj7,4);
	ObjEffect_SetLayer(obj7,8);
	Obj_SetPosition(obj7,cx+295+77,cy-175);

	let obj8=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj8,false);
	ObjEffect_SetTexture(obj8,imgScore);
	ObjEffect_SetPrimitiveType(obj8,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj8,4);
	ObjEffect_SetLayer(obj8,8);
	Obj_SetPosition(obj8,cx+295+88,cy-175);

	let obj9=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj9,false);
	ObjEffect_SetTexture(obj9,imgScore);
	ObjEffect_SetPrimitiveType(obj9,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj9,4);
	ObjEffect_SetLayer(obj9,8);
	Obj_SetPosition(obj9,cx+295+99,cy-175);
	let PX1 = [ -8,  8, -8,  8];
	let PY1 = [-16,-16, 16, 16];
	ascent( let i in 0..4){
		ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj2,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj3,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj4,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj5,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj6,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj7,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj8,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj9,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexColor(obj0,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj1,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj2,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj3,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj4,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj5,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj6,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj7,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj8,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj9,i,255,0,0,0);
	}
	let X=[144,128,144,160,176,192,208,224,240,128];
	let Y=[ 32,  0,  0,  0,  0,  0,  0,  0,  0, 32];
	let PX2 = [  0, 16,  0, 16];
	let PY2 = [  0,  0, 32, 32];
	loop{
		let GS=GetCommonData("Score");
		let GS2=GetCommonData("Score_2");
		S0 = truncate(GS2/1000)-truncate(GS2/10000)*10;
		S1 = truncate(GS2/100)- truncate(GS2/1000)*10;
		S2 = truncate(GS2/10)-  truncate(GS2/100)*10;
		S3 = truncate(GS2)-     truncate(GS2/10)*10;
		S4 = truncate(GS/100000)-    truncate(GS/1000000)*10;
		S5 = truncate(GS/10000)-     truncate(GS/100000)*10;
		S6 = truncate(GS/1000)-      truncate(GS/10000)*10;
		S7 = truncate(GS/100)-       truncate(GS/1000)*10;
		S8 = truncate(GS/10)-        truncate(GS/100)*10;
		S9 = truncate(GS/1)-         truncate(GS/10)*10;
		ascent( let i in 0..4){
			ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,Y[S0]+PY2[i]);
			ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,Y[S1]+PY2[i]);
			ObjEffect_SetVertexUV(obj2,i,X[S2]+PX2[i] ,Y[S2]+PY2[i]);
			ObjEffect_SetVertexUV(obj3,i,X[S3]+PX2[i] ,Y[S3]+PY2[i]);
			ObjEffect_SetVertexUV(obj4,i,X[S4]+PX2[i] ,Y[S4]+PY2[i]);
			ObjEffect_SetVertexUV(obj5,i,X[S5]+PX2[i] ,Y[S5]+PY2[i]);
			ObjEffect_SetVertexUV(obj6,i,X[S6]+PX2[i] ,Y[S6]+PY2[i]);
			ObjEffect_SetVertexUV(obj7,i,X[S7]+PX2[i] ,Y[S7]+PY2[i]);
			ObjEffect_SetVertexUV(obj8,i,X[S8]+PX2[i] ,Y[S8]+PY2[i]);
			ObjEffect_SetVertexUV(obj9,i,X[S9]+PX2[i] ,Y[S9]+PY2[i]);
		}
		loop(2){yield;}
	}
}

task Score_Up{//桁上げ
	let GS=GetCommonData("Score");
	loop{
		GS  = GetCommonData("Score");
		if( GS >= 1000000){
			SetCommonData("Score",0);
			SetCommonData("Score_2", GetCommonData("Score_2") + 1 );
		}
		loop(2){yield;}
	}
}

task PB_Ster{//残機とボム数
	let MissSwich =false;
	let Life = 0;
	loop{
		Life =GetCommonData("PlayerLife");
		if(OnPlayerMissed==true){		//ミス時自機の数にLifeをあわせる
			if(MissSwich==false){
				Life-=1;		//自機の数にLifeをあわせる
				SetCommonData("PlayerLife",Life);
				MissSwich=true;		//処理終了、次のミスまでこの処理を行わない
			}

		}
		else{					//通常時は戻す
			MissSwich =false;
			if(Life<GetPlayerLife){		//自機の数にLifeをあわせる、食らいボム用
				Life+=1;		
				SetCommonData("PlayerLife",Life);
			}
		}
		if(OnPlayerMissed==false&&Life>GetPlayerLife){	//アイテムエクステンドでの残機調整
			ExtendPlayer(1);
		}

		let PX=0;
		loop(GetPlayerLife-1){//★表示
			PB_Ster2(PX,130,0,40,40);
			PX+=14;
		}
		let PX=0;
		loop(GetPlayerBomb){//★表示
			PB_Ster2(PX,106,40,40,0);
			PX+=14;
		}
		loop(2){yield;}
	}
	task PB_Ster2(PX,PY,col1,col2,col3){//★表示
		let obj=Obj_Create(OBJ_EFFECT);
		Obj_SetAutoDelete(obj,false);
		ObjEffect_SetTexture(obj,imgScore);
		ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
		ObjEffect_CreateVertex(obj,4);
		ObjEffect_SetVertexXY(obj,0,-8,-9);
		ObjEffect_SetVertexXY(obj,1, 8,-9);
		ObjEffect_SetVertexXY(obj,2,-8, 9);
		ObjEffect_SetVertexXY(obj,3, 8, 9);
		ObjEffect_SetVertexColor(obj,0,255,255-col1*2,255-col2*2,255-col3*2);
		ObjEffect_SetVertexColor(obj,1,255,255-col1  ,255-col2  ,255-col3  );
		ObjEffect_SetVertexColor(obj,2,255,255-col1*5,255-col2*5,255-col3*5);
		ObjEffect_SetVertexColor(obj,3,255,255-col1*7,255-col2*7,255-col3*7);
		ObjEffect_SetVertexUV(obj,0,128,64);
		ObjEffect_SetVertexUV(obj,1,144,64);
		ObjEffect_SetVertexUV(obj,2,128,82);
		ObjEffect_SetVertexUV(obj,3,144,82);
		ObjEffect_SetLayer(obj,8);
		Obj_SetPosition(obj,cx+284+PX,cy-PY);
		loop(2){yield;}
		Obj_Delete(obj);
	}
}



task PowerTask{//パワー
	PowerSE;
	let S0=0;
	let S1=0;
	let S2=0;
	let P_M = false;//ミス時パワー減少管理

	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,8);
	Obj_SetPosition(obj0,cx+295+33,cy-58);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,8);
	Obj_SetPosition(obj1,cx+295+55,cy-58);

	let obj2=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj2,false);
	ObjEffect_SetTexture(obj2,imgScore);
	ObjEffect_SetPrimitiveType(obj2,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj2,4);
	ObjEffect_SetLayer(obj2,8);
	Obj_SetPosition(obj2,cx+295+66,cy-58);

	let obj3=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj3,false);
	ObjEffect_SetTexture(obj3,imgScore);
	ObjEffect_SetPrimitiveType(obj3,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj3,4);
	ObjEffect_SetLayer(obj3,8);
	Obj_SetPosition(obj3,cx+295+44,cy-58);
	let PX1 = [ -8,  8, -8,  8];
	let PY1 = [-16,-16, 16, 16];
	let PX2 = [  0, 16,  0, 16];
	let PY2 = [  0,  0, 32, 32];
	ascent( let i in 0..4){
		ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj2,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj3,i,PX1[i],PY1[i]);

		ObjEffect_SetVertexUV(obj3,i,160+PX2[i] ,32+PY2[i]);
		ObjEffect_SetVertexColor(obj0,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj1,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj2,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj3,i,255,0,0,0);
	}
	let X=[144,128,144,160,176,192,208,224,240,128];
	let Y=[ 32,  0,  0,  0,  0,  0,  0,  0,  0, 32];
	loop{
		if(GetCommonData("Power")>=500){SetCommonData("Power",500);}
		let Power=GetCommonData("Power");
		if(OnPlayerMissed == true){
			if(P_M == false){MissTask(Power);}
		}
		S0 = truncate(Power/100)-       truncate(Power/1000)*10;
		S1 = truncate(Power/10)-        truncate(Power/100)*10;
		S2 = truncate(Power/1)-         truncate(Power/10)*10;
		ascent( let i in 0..4){
			ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,Y[S0]+PY2[i]);
			ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,Y[S1]+PY2[i]);
			ObjEffect_SetVertexUV(obj2,i,X[S2]+PX2[i] ,Y[S2]+PY2[i]);
		}
		loop(2){yield;}
	}

	task MissTask(Power){//ミス時のパワー減少
		loop(10){
			if(OnBomb == true){return;}//くらいボムした場合は脱出
			yield;
		}
		if(Power < 100){			//100以下なら0になる
			SetCommonData("Power",0);
			Power=0;
		}
		if(Power == 0){return;}			//0なら脱出
		P_M = true;				//復帰までこのタスクに入れないように
		SetCommonData("Power",Power-100);	//それ以外は100減少
		while(OnPlayerMissed == true){yield}	//復活まで待機
		P_M = false;				//このタスクに入れるように
	}

}

task PowerSE{//パワー上昇効果音管理
	loop{
		let Power=GetCommonData("Power");
		let i=1;
		loop(5){
			if(Power>=100*i&&Power<100*(i+1)){				//現在のパワーを探す
				if(OnPlayerMissed==false){PlaySE(warp02);}
				loop{							//待機
					Power=GetCommonData("Power");
					if(Power<100*i || Power>=100*(i+1)){break;}	//現在のパワーからブレイク
					yield;
				}
			}
			i++;
		}
		loop(2){yield;}
	}

}
task GrazeTask{//グレイズ
	let Graze=GetGraze;
	let S0=0;
	let S1=0;
	let S2=0;
	let S3=0;
	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,8);
	Obj_SetPosition(obj0,cx+295+33,cy-33);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,8);
	Obj_SetPosition(obj1,cx+295+44,cy-33);

	let obj2=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj2,false);
	ObjEffect_SetTexture(obj2,imgScore);
	ObjEffect_SetPrimitiveType(obj2,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj2,4);
	ObjEffect_SetLayer(obj2,8);
	Obj_SetPosition(obj2,cx+295+55,cy-33);

	let obj3=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj3,false);
	ObjEffect_SetTexture(obj3,imgScore);
	ObjEffect_SetPrimitiveType(obj3,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj3,4);
	ObjEffect_SetLayer(obj3,8);
	Obj_SetPosition(obj3,cx+295+66,cy-33);
	let PX1 = [ -8,  8, -8,  8];
	let PY1 = [-16,-16, 16, 16];
	ascent( let i in 0..4){
		ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj2,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj3,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexColor(obj0,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj1,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj2,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj3,i,255,0,0,0);
	}

	let X=[144,128,144,160,176,192,208,224,240,128];
	let Y=[ 32,  0,  0,  0,  0,  0,  0,  0,  0, 32];
	let PX2 = [  0, 16,  0, 16];
	let PY2 = [  0,  0, 32, 32];
	loop{
		Graze=GetGraze;
		if(Graze>=9999){ Graze= 9999;}
		S0 = truncate(Graze/1000)-truncate(Graze/10000)*10;
		S1 = truncate(Graze/100)- truncate(Graze/1000)*10;
		S2 = truncate(Graze/10) - truncate(Graze/100)*10;
		S3 = truncate(Graze/1)  - truncate(Graze/10)*10;
		ascent( let i in 0..4){
			ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,Y[S0]+PY2[i]);
			ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,Y[S1]+PY2[i]);
			ObjEffect_SetVertexUV(obj2,i,X[S2]+PX2[i] ,Y[S2]+PY2[i]);
			ObjEffect_SetVertexUV(obj3,i,X[S3]+PX2[i] ,Y[S3]+PY2[i]);
		}
		if(Graze>=9999){break;}
		loop(2){yield;}
	}
}

task PointTask{//ポイント
	let S0 = 0;
	let S1 = 0;
	let S2 = 0;
	let S3 = 0;
	let S4 = 0;
	let S5 = 0;
	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,8);
	Obj_SetPosition(obj0,cx+295+00,cy-8);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,8);
	Obj_SetPosition(obj1,cx+295+11,cy-8);

	let obj2=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj2,false);
	ObjEffect_SetTexture(obj2,imgScore);
	ObjEffect_SetPrimitiveType(obj2,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj2,4);
	ObjEffect_SetLayer(obj2,8);
	Obj_SetPosition(obj2,cx+295+22,cy-8);

	//スラッシュ-------------------------------------------------------
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj,false);
	ObjEffect_SetTexture(obj,imgScore);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	ObjEffect_SetVertexXY(obj,0,-4,-8);
	ObjEffect_SetVertexXY(obj,1, 5,-8);
	ObjEffect_SetVertexXY(obj,2,-4, 8);
	ObjEffect_SetVertexXY(obj,3, 5, 8);
	ObjEffect_SetVertexColor(obj,0,255,0,0,0);
	ObjEffect_SetVertexColor(obj,1,255,0,0,0);
	ObjEffect_SetVertexColor(obj,2,255,0,0,0);
	ObjEffect_SetVertexColor(obj,3,255,0,0,0);
	ObjEffect_SetVertexUV(obj,0,149,66);
	ObjEffect_SetVertexUV(obj,1,158,66);
	ObjEffect_SetVertexUV(obj,2,149,82);
	ObjEffect_SetVertexUV(obj,3,158,82);
	ObjEffect_SetLayer(obj,8);
	Obj_SetPosition(obj,cx+295+33,cy-8);
	//スラッシュ-------------------------------------------------------

	let obj3=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj3,false);
	ObjEffect_SetTexture(obj3,imgScore);
	ObjEffect_SetPrimitiveType(obj3,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj3,4);
	ObjEffect_SetLayer(obj3,8);
	Obj_SetPosition(obj3,cx+295+44,cy-8);

	let obj4=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj4,false);
	ObjEffect_SetTexture(obj4,imgScore);
	ObjEffect_SetPrimitiveType(obj4,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj4,4);
	ObjEffect_SetLayer(obj4,8);
	Obj_SetPosition(obj4,cx+295+55,cy-8);

	let obj5=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj5,false);
	ObjEffect_SetTexture(obj5,imgScore);
	ObjEffect_SetPrimitiveType(obj5,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj5,4);
	ObjEffect_SetLayer(obj5,8);
	Obj_SetPosition(obj5,cx+295+66,cy-8);
	let PX1 = [ -8,  8, -8,  8];
	let PY1 = [-16,-16, 16, 16];
	ascent( let i in 0..4){
		ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj2,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj3,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj4,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj5,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexColor(obj0,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj1,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj2,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj3,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj4,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj5,i,255,0,0,0);
	}
	let X=[144,128,144,160,176,192,208,224,240,128];
	let Y=[ 32,  0,  0,  0,  0,  0,  0,  0,  0, 32];
	let PX2 = [  0, 16,  0, 16];
	let PY2 = [  0,  0, 32, 32];
	let ExtendLine1 =false;
	let ExtendLine2 =false; 
	loop{
		let Points=GetPoint;
		S0 = truncate(Points/100)-truncate(Points/1000)*10;
		S1 = truncate(Points/10)- truncate(Points/100)*10;
		S2 = truncate(Points/1) - truncate(Points/10)*10;
		if(Points<100 && ExtendLine1 ==false){
			S3 = 1;
			S4 = 0;
			S5 = 0;
		}
		else if(Points<300 && ExtendLine2 ==false){
			if(ExtendLine1 ==false){
				ExtendTask;
			}
			ExtendLine1 =true;
			S3 = 3;
			S4 = 0;
			S5 = 0;
		}
		else if(Points>=300 ){
			if(ExtendLine2 ==false){
				ExtendTask;
			}
			ExtendLine2 =true;
			S3 = 9;
			S4 = 9;
			S5 = 9;
		}
		ascent( let i in 0..4){
			ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,Y[S0]+PY2[i]);
			ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,Y[S1]+PY2[i]);
			ObjEffect_SetVertexUV(obj2,i,X[S2]+PX2[i] ,Y[S2]+PY2[i]);
			ObjEffect_SetVertexUV(obj3,i,X[S3]+PX2[i] ,Y[S3]+PY2[i]);
			ObjEffect_SetVertexUV(obj4,i,X[S4]+PX2[i] ,Y[S4]+PY2[i]);
			ObjEffect_SetVertexUV(obj5,i,X[S5]+PX2[i] ,Y[S5]+PY2[i]);
		}
		yield;
	}
	task ExtendTask{
		let Life =GetCommonData("PlayerLife");	
		SetCommonData("PlayerLife",Life+1);	//"PlayerLife"増加
		ExtendPlayer(1);			//自機増加
		PlaySE(power33);			//効果音
		let Y=0;
		let obj=Obj_Create(OBJ_EFFECT);
		Obj_SetAutoDelete(obj,false);
		ObjEffect_SetTexture(obj,imgScore);
		ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
		ObjEffect_CreateVertex(obj,4);
		ObjEffect_SetVertexColor(obj,0,255,255,128,255);
		ObjEffect_SetVertexColor(obj,1,255,255,128,255);
		ObjEffect_SetVertexColor(obj,2,255,255,64,255);
		ObjEffect_SetVertexColor(obj,3,255,255,64,255);
		ObjEffect_SetVertexUV(obj,0,176,32);
		ObjEffect_SetVertexUV(obj,1,256,32);
		ObjEffect_SetVertexUV(obj,2,176,64);
		ObjEffect_SetVertexUV(obj,3,256,64);
		ObjEffect_SetLayer(obj,8);	
		Obj_SetPosition(obj,cx,cy-200);
		loop(10){
			Y+=16/10;
			ObjEffect_SetVertexXY(obj,0,-40,-Y);
			ObjEffect_SetVertexXY(obj,1, 40,-Y);
			ObjEffect_SetVertexXY(obj,2,-40, Y);
			ObjEffect_SetVertexXY(obj,3, 40, Y);
			yield;
		}
		loop(120){yield;}
		loop(10){
			Y-=16/10;
			ObjEffect_SetVertexXY(obj,0,-40,-Y);
			ObjEffect_SetVertexXY(obj,1, 40,-Y);
			ObjEffect_SetVertexXY(obj,2,-40, Y);
			ObjEffect_SetVertexXY(obj,3, 40, Y);
			yield;
		}
		Obj_Delete(obj);
	}
}

task IceTask{//アイスポイント
	let S0 = 0;
	let S1 = 0;
	let S2 = 0;
	let S3 = 0;
	let S4 = 0;
	let S5 = 0;

	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,8);
	Obj_SetPosition(obj0,cx+295+11,cy+17);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,8);
	Obj_SetPosition(obj1,cx+295+22,cy+17);

	let obj2=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj2,false);
	ObjEffect_SetTexture(obj2,imgScore);
	ObjEffect_SetPrimitiveType(obj2,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj2,4);
	ObjEffect_SetLayer(obj2,8);
	Obj_SetPosition(obj2,cx+295+33,cy+17);

	let obj3=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj3,false);
	ObjEffect_SetTexture(obj3,imgScore);
	ObjEffect_SetPrimitiveType(obj3,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj3,4);
	ObjEffect_SetLayer(obj3,8);
	Obj_SetPosition(obj3,cx+295+44,cy+17);

	let obj4=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj4,false);
	ObjEffect_SetTexture(obj4,imgScore);
	ObjEffect_SetPrimitiveType(obj4,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj4,4);
	ObjEffect_SetLayer(obj4,8);
	Obj_SetPosition(obj4,cx+295+55,cy+17);

	let obj5=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj5,false);
	ObjEffect_SetTexture(obj5,imgScore);
	ObjEffect_SetPrimitiveType(obj5,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj5,4);
	ObjEffect_SetLayer(obj5,8);
	Obj_SetPosition(obj5,cx+295+66,cy+17);

	let PX1 = [ -8,  8, -8,  8];
	let PY1 = [-16,-16, 16, 16];
	ascent( let i in 0..4){
		ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj2,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj3,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj4,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexXY(obj5,i,PX1[i],PY1[i]);
		ObjEffect_SetVertexColor(obj0,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj1,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj2,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj3,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj4,i,255,0,0,0);
		ObjEffect_SetVertexColor(obj5,i,255,0,0,0);
	}
	let X=[144,128,144,160,176,192,208,224,240,128];
	let Y=[ 32,  0,  0,  0,  0,  0,  0,  0,  0, 32];
	let PX2 = [  0, 16,  0, 16];
	let PY2 = [  0,  0, 32, 32];
	loop{
		let IceScore = GetCommonData("GetIce");
		if(IceScore <= 0 ){
			SetCommonData("GetIce",0);
			IceScore = 0;
		}
		S0 = truncate(IceScore/100000)- truncate(IceScore/1000000)*10;
		S1 = truncate(IceScore/10000) - truncate(IceScore/100000)*10;
		S2 = truncate(IceScore/1000)  - truncate(IceScore/10000)*10;
		S3 = truncate(IceScore/100)   - truncate(IceScore/1000)*10;
		S4 = truncate(IceScore/10)    - truncate(IceScore/100)*10;
		S5 = truncate(IceScore)       - truncate(IceScore/10)*10;
		ascent( let i in 0..4){
			ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,Y[S0]+PY2[i]);
			ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,Y[S1]+PY2[i]);
			ObjEffect_SetVertexUV(obj2,i,X[S2]+PX2[i] ,Y[S2]+PY2[i]);
			ObjEffect_SetVertexUV(obj3,i,X[S3]+PX2[i] ,Y[S3]+PY2[i]);
			ObjEffect_SetVertexUV(obj4,i,X[S4]+PX2[i] ,Y[S4]+PY2[i]);
			ObjEffect_SetVertexUV(obj5,i,X[S5]+PX2[i] ,Y[S5]+PY2[i]);
		}
		loop(2){yield;}
	}
}

task AddSistemTask{//追加システム
	let IceScore = 0;
	let Points = 0;
	let S0 = 0;
	let S1 = 0;
	let S2 = 0;
	let S3 = 0;
	let S4 = 0;
	let S5 = 0;
	//------------------------------------------------点アイテムマーク
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj,false);
	ObjEffect_SetTexture(obj,effect_tiny);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	ObjEffect_SetVertexXY(obj,0,-6,-6);
	ObjEffect_SetVertexXY(obj,1, 6,-6);
	ObjEffect_SetVertexXY(obj,2,-6, 6);
	ObjEffect_SetVertexXY(obj,3, 6, 6);
	ObjEffect_SetVertexUV(obj,0,16,176);
	ObjEffect_SetVertexUV(obj,1,28,176);
	ObjEffect_SetVertexUV(obj,2,16,188);
	ObjEffect_SetVertexUV(obj,3,28,188);
	ObjEffect_SetLayer(obj,2);
	Obj_SetPosition(obj,cmx+12,cmY-12);
	//------------------------------------------------点アイテムマーク
	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,2);
	Obj_SetPosition(obj0,cmx+12+12,cmY-14);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,2);
	Obj_SetPosition(obj1,cmx+12+22,cmY-14);

	let obj2=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj2,false);
	ObjEffect_SetTexture(obj2,imgScore);
	ObjEffect_SetPrimitiveType(obj2,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj2,4);
	ObjEffect_SetLayer(obj2,2);
	Obj_SetPosition(obj2,cmx+12+32,cmY-14);

	let obj3=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj3,false);
	ObjEffect_SetTexture(obj3,imgScore);
	ObjEffect_SetPrimitiveType(obj3,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj3,4);
	ObjEffect_SetLayer(obj3,2);
	Obj_SetPosition(obj3,cmx+12+42,cmY-14);

	let obj4=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj4,false);
	ObjEffect_SetTexture(obj4,imgScore);
	ObjEffect_SetPrimitiveType(obj4,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj4,4);
	ObjEffect_SetLayer(obj4,2);
	Obj_SetPosition(obj4,cmx+12+52,cmY-14);

	let obj5=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj5,false);
	ObjEffect_SetTexture(obj5,imgScore);
	ObjEffect_SetPrimitiveType(obj5,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj5,4);
	ObjEffect_SetLayer(obj5,2);
	Obj_SetPosition(obj5,cmx+12+62,cmY-14);
	let PX1=[-5, 5,-5, 5];
	let PY1=[-6,-6, 7, 7];
	ascent( let i in 0..4){
			ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
			ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
			ObjEffect_SetVertexXY(obj2,i,PX1[i],PY1[i]);
			ObjEffect_SetVertexXY(obj3,i,PX1[i],PY1[i]);
			ObjEffect_SetVertexXY(obj4,i,PX1[i],PY1[i]);
			ObjEffect_SetVertexXY(obj5,i,PX1[i],PY1[i]);
	}
	let X=[128,138,148,158,168,178,188,198,208,218];
	let PX2=[ 0, 9, 0, 9];
	let PY2=[82,82,95,95];
	let a=255;
	let col=0;
	loop{
		IceScore = GetCommonData("GetIce");
		Points = 200000 + GetGraze * 10 + IceScore + truncate(GetScore / 200);
		if( Points >= 999999){Points = 999999}
		S0 = truncate(Points/100000)-truncate(Points/1000000)*10;
		S1 = truncate(Points/10000)-truncate(Points/100000)*10;
		S2 = truncate(Points/1000) -truncate(Points/10000)*10;
		S3 = truncate(Points/100)  -truncate(Points/1000)*10;
		S4 = truncate(Points/10)   -truncate(Points/100)*10;
		S5 = truncate(Points)      -truncate(Points/10)*10;
		
		ascent( let i in 0..4){
			ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexUV(obj2,i,X[S2]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexUV(obj3,i,X[S3]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexUV(obj4,i,X[S4]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexUV(obj5,i,X[S5]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexColor(obj ,i,a,255,255,255);
			ObjEffect_SetVertexColor(obj0,i,a,col,col,col);
			ObjEffect_SetVertexColor(obj1,i,a,col,col,col);
			ObjEffect_SetVertexColor(obj2,i,a,col,col,col);
			ObjEffect_SetVertexColor(obj3,i,a,col,col,col);
			ObjEffect_SetVertexColor(obj4,i,a,col,col,col);
			ObjEffect_SetVertexColor(obj5,i,a,col,col,col);
		}
		if(GetCommonData("SpellCade")==true){col=255;}
		else{col=0;}
		if(GetPlayerX<=cmx+120&&GetPlayerY>=cmY-60){a=96;}
		else{a=255;}
		yield;
	}
}

task CTask{
	let Cs = GetCommonData("C");
	let S0 = 0;
	let S1 = 0;
	let a=255;
	let col=0;

	let obj0=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj0,false);
	ObjEffect_SetTexture(obj0,imgScore);
	ObjEffect_SetPrimitiveType(obj0,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj0,4);
	ObjEffect_SetLayer(obj0,2);
	Obj_SetPosition(obj0,cmx+12+42,cmY-28);

	let obj1=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj1,false);
	ObjEffect_SetTexture(obj1,imgScore);
	ObjEffect_SetPrimitiveType(obj1,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj1,4);
	ObjEffect_SetLayer(obj1,2);
	Obj_SetPosition(obj1,cmx+12+52,cmY-28);
	//------------------------------------------------Cマーク
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj,false);
	ObjEffect_SetTexture(obj,imgScore);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	ObjEffect_SetVertexXY(obj,0,-6,-6);
	ObjEffect_SetVertexXY(obj,1, 5,-6);
	ObjEffect_SetVertexXY(obj,2,-6, 6);
	ObjEffect_SetVertexXY(obj,3, 5, 6);
	ObjEffect_SetVertexUV(obj,0,228,82);
	ObjEffect_SetVertexUV(obj,1,239,82);
	ObjEffect_SetVertexUV(obj,2,229,95);
	ObjEffect_SetVertexUV(obj,3,239,95);
	ascent( let i in 0..4){
			ObjEffect_SetVertexColor(obj,i,a,col,col,col);
	}
	ObjEffect_SetLayer(obj,2);
	Obj_SetPosition(obj,cmx+12+63,cmY-28);
	//------------------------------------------------Cマーク

	let PX1=[-5, 5,-5, 5];
	let PY1=[-6,-6, 7, 7];
	ascent( let i in 0..4){
			ObjEffect_SetVertexXY(obj0,i,PX1[i],PY1[i]);
			ObjEffect_SetVertexXY(obj1,i,PX1[i],PY1[i]);
	}
	let X=[128,138,148,158,168,178,188,198,208,218];
	let PX2=[ 0, 9, 0, 9];
	let PY2=[82,82,95,95];
	loop{
		Cs = GetCommonData("C");	//温度取得
		if(Cs<0){
			SetCommonData("C",0);
			Cs=0;
		}
		if(Cs>1899){
			SetCommonData("C",1800);
			Cs=1800;
		}
		S0 = truncate(Cs/1000)-truncate(Cs/10000)*10;
		S1 = truncate(Cs/100) -truncate(Cs/1000)*10;	
		ascent( let i in 0..4){
			ObjEffect_SetVertexUV(obj0,i,X[S0]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexUV(obj1,i,X[S1]+PX2[i] ,PY2[i]);
			ObjEffect_SetVertexColor(obj0,i,a,col,col,col);
			ObjEffect_SetVertexColor(obj1,i,a,col,col,col);
			ObjEffect_SetVertexColor(obj ,i,a,col,col,col);
		}
		if(GetCommonData("SpellCade")==true){col=255;}
		else{col=0;}
		if(GetPlayerX<=cmx+120&&GetPlayerY>=cmY-60){a=96;}
		else{a=255;}
		yield;
	}

}

task CUpTask{//気温上昇
	loop{
		let Cs = GetCommonData("C");
		SetCommonData("C",Cs+50);
		if(Cs>1800){SetCommonData("C",1750);}
		loop(50){yield;}
	}

}

task ScoreNun(PX,PY,i){//数字を表示
	let X=[144,128,144,160,176,192,208,224,240,128];
	let Y=[ 32,  0,  0,  0,  0,  0,  0,  0,  0, 32];
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetAutoDelete(obj,false);
	ObjEffect_SetTexture(obj,imgScore);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	ObjEffect_SetVertexXY(obj,0,-8,-16);
	ObjEffect_SetVertexXY(obj,1, 8,-16);
	ObjEffect_SetVertexXY(obj,2,-8, 16);
	ObjEffect_SetVertexXY(obj,3, 8, 16);
	ObjEffect_SetVertexUV(obj,0,X[i]   ,Y[i]);
	ObjEffect_SetVertexUV(obj,1,X[i]+16,Y[i]);
	ObjEffect_SetVertexUV(obj,2,X[i]   ,Y[i]+32);
	ObjEffect_SetVertexUV(obj,3,X[i]+16,Y[i]+32);
	ObjEffect_SetVertexColor(obj,0,255,0,0,0);
	ObjEffect_SetVertexColor(obj,1,255,0,0,0);
	ObjEffect_SetVertexColor(obj,2,255,0,0,0);
	ObjEffect_SetVertexColor(obj,3,255,0,0,0);
	ObjEffect_SetLayer(obj,8);
	Obj_SetPosition(obj,cx+295+PX,cy-PY);
	yield;
	Obj_Delete(obj);
}