	#東方弾幕風[Stage]
	#Title[Magical Singular Day ver0.01]
	#Text[Magical Singular Day ver0.01]
	#Player[.\player/MarisaA\MarisaA.txt,.\player/MarisaA\MarisaAAuto.txt,.\player/MarisaB\MarisaB.txt,.\player/MarisaB\MarisaBAuto.txt]
	#BackGround[User]
	#BackGround[Defalt]
	#ScriptVersion[2]

	script_stage_main
	{
	SetRateScoreSystemEnable(false);
	SetDefaultStatusVisible(false);
	let csd=GetCurrentScriptDirectory;
	let imgBG=csd ~ "img/MenuBG.png";

	let imgMenuEffect=csd ~ "img/effect_tiny.png";

	let imgMenuLetter=csd ~ "img/menuletter.png";
	let imgNumber=csd ~ "img/Number.png";
	let imgStatusLetter=csd ~ "img/StatusLetter.png";
	let imgBer=csd ~ "img/ber.png";
	let imgBer2=csd ~ "img/ber2.png";

	let MenuSE=[csd ~ "se/clock03.wav",csd ~ "se/cursor01.wav"];
	let BGM=[csd ~ "bgm/title.wav",csd ~ "bgm/stage1.wav",csd ~ "bgm/stage1boss.wav",csd ~ "bgm/stage2.wav",csd ~ "bgm/stage2boss.wav",csd ~ "bgm/stage3.wav",csd ~ "bgm/stage3boss.wav",
		csd ~ "bgm/stage4.wav",csd ~ "bgm/stage4boss.wav",csd ~ "bgm/stage5.wav",csd ~ "bgm/stage5boss.wav",csd ~ "bgm/stage6.wav",csd ~ "bgm/stage6boss.wav"];

	let Hiscore=[];
	let Hiscore2=[];
	ascent(let k in 0..10)
	{
		Hiscore = Hiscore ~ [k];
		Hiscore2 = Hiscore2 ~ [k];
	}

	let SelectedDifficult="Difficult";
	let StageProgress=1;
	let StagePractice=false;

	let bgX=0;
	let bgX2=300;
	let bgY=0;
	let bgY2=300;
	let bgY3=300;
	let bgrt=0;
	let ViewFromX=300;
	let stage1alpha1=0;
	let stage1alpha2=0;
	let stage1alpha3=0;
	let stage1scale3=0;
	let StageChange=false;
	let stage2alpha=0;
	let stage3alpha=0;
	let stage4alpha1=0;
	let stage4alpha2=0;
	let stage5alpha1=0;
	let stage5alpha2=0;
	let stage6alpha1=0;
	let stage6alpha2=0;

	let ScoreNumber1=0;
	let ScoreNumber2=0;

	let BGDrawing=1;
	let GetItemScoreDrawing=1;
	let ItemPointerDrawing=1;

	#include_function ".\txt\DifineMenuVariable.txt"//メニュー画面管理用の値の収納先

		task StageTask
		{
			yield;
			LifeAndBombDefine;
			PlayMusic(BGM[0]);
			UpTimeCount;//起動時間計測
			PlayTimeCount;//プレイ時間計測

	//		MenuEffect;//メニューの紅葉
			StageTitleDisplay;
			StatusDisplay;//文字を表示
			PlayerAndBombDisplay;//残機とボム表示
			ForbidShot(false);
			ForbidBomb(false);
			PlayCharacterAndDifficult;//使用キャラと難易度のプレイ回数の記録
			HiScoreLoad;//ハイスコアをロード
			DifficultDisplay;//難易度を表示
			DisPlayScore;//スコアを表示
//StageStartEffect;
			ExtendSystem;
			EnemyLifeDisplay;
			BossLifeSetting;
			TimeBonus;
			if(BGDrawing==1)
			{
				BGGraphicRect;//ステージ背景の矩形処理など
			}
			DeleteUsedFile;
			if(StageProgress==1)
			{
				SetCommonData("STAGEPROGRESS",1);
				Stage1;
			//	while(StageProgress==1){yield;}
				if(StagePractice==true)
				{
					StageProgress=1;
					wait(240);
					ClearStage;
				}
			Stage1End;
			StageChange=true;
			wait(240);
			}
			StageChange=false;
/*
			AddGraze(-GetGraze);
			if(StageProgress==2)
			{
				Stage2;
				SetCommonData("STAGEPROGRESS",2);
				while(StageProgress==2){yield;}
				if(StagePractice==true)
				{
					StageProgress=2;
					wait(240);
					ClearStage;
				}
			DeleteGraphic(csd~"img\stage2bg.png");
			wait(60);

			AddGraze(-GetGraze);
			}
			if(StageProgress==3)
			{
				Stage3;
				SetCommonData("STAGEPROGRESS",3);
				while(StageProgress==3){yield;}
				if(StagePractice==true)
				{
					StageProgress=3;
					wait(240);
					ClearStage;
				}
			wait(60);

			AddGraze(-GetGraze);
			}

			if(StageProgress==4)
			{
				Stage4;
				SetCommonData("STAGEPROGRESS",4);
				while(StageProgress==4){yield;}
				if(StagePractice==true)
				{
					StageProgress=4;
					wait(240);
					ClearStage;
				}
			DeleteGraphic(csd~"img\stage4bg.png");
			wait(60);

			AddGraze(-GetGraze);
			}

			if(StageProgress==5)
			{
				Stage5;
				SetCommonData("STAGEPROGRESS",5);
				while(StageProgress==5){yield;}
				if(StagePractice==true)
				{
					StageProgress=5;
					wait(240);
					ClearStage;
				}
			DeleteGraphic(csd~"img\stage5bg.png");
			wait(60);

			AddGraze(-GetGraze);
			}

			if(StageProgress==6)
			{
				Stage6;
				SetCommonData("STAGEPROGRESS",6);
				while(StageProgress==6){yield;}
				if(StagePractice==true)
				{
					StageProgress=6;
					wait(240);
					ClearStage;
				}
			SetCommonData("STAGECLEAR",true);
			wait(120);
			}
			CrearBonus;
			wait(600);
			if(Continued==false && StagePractice==false)
			{
				SetCommonDataEx(NsScore,"SecretFlag","true");
				SetCommonDataEx(NsScore,"ExFlag","true");
			}
*/
			ClearStage;
		}
	
		
		@Initialize()
		{
			SetCommonData("MagicalSingularDay",true);
		//	ExpertEx(false,1,3);
			LoadGraphic(csd~"img\st1bg1.png");
			LoadGraphic(csd~"img\cloud.png");
		//	LoadGraphic(csd~"img\sub.png");
		//	LoadGraphic(csd ~ "stg2bg.png");
			LoadGraphic(imgBG);
		//	LoadGraphic(imgMenuEffect);
      		//	LoadGraphic(csd~"img\circle.png");
      			LoadGraphic(imgMenuLetter);
      			LoadGraphic(imgBer2);
      			LoadGraphic(imgNumber);
      			LoadGraphic(imgStatusLetter);
			if(BGDrawing==1)
			{
			LoadGraphic(csd ~ "img\White.png");
		//	LoadGraphic(csd ~ "img\fog.png");
		/*	LoadGraphic(csd ~ "img\stage2bg.png");
			LoadGraphic(csd ~ "img\stage3bg.png");
			LoadGraphic(csd ~ "img\stage4bg.png");
			LoadGraphic(csd ~ "img\stage5bg.png");
			LoadGraphic(csd ~ "img\stage6bg.png");
		*/
			}
			LoadGraphic(imgBer);

			CreateCommonDataArea(NsScore);
			LoadCommonDataEx(NsScore,savePathstage);
			SetCommonData(NsGetSpell,0);
			let isRep = IsReplay();
			SetCommonData(NsIsReplay,isRep);
			StageTask();
		}
	
		@MainLoop()
		{
			yield;
			if(OnPlayerMissed)
			{
				SetCommonData("Playermissed",true);
			}
			else
			{
				SetCommonData("Playermissed",false);
			}

		}
		

		@DrawTopObject
		{
			SetTexture(imgBG);
			SetGraphicScale(30.0,30.0);
			SetGraphicRect(0,0,16,16);
			if(StageState==Menu)
			{
				SetGraphicAngle(0, 0, 0);
				SetViewTo(0,0,0);
				DrawGraphic(GetCenterX, GetCenterY);
			}
			//DrawText(NumToString(GetCommonDataDefaultEx(NsScore,NsUpTime,0)),320,432,12,255);//起動時間の表示
			//DrawText(NumToString(GetCommonDataDefaultEx(NsScore,NsPlayTime,0)/60),320,452,12,255);//プレイ時間の表示
			//DrawText(StageState,120,432,12,255);//起動時間の表示
			//DrawText(DefinedPlayer1,120,452,12,255);//プレイ時間の表示
			//DrawText(SelectedCharacter,120,412,12,255);//起動時間の表示
			MenuDraw;
		}

		@Finalize()
		{
			SetCommonDataEx(NsScore,"ExFlag","true");
			HiScoreSave;
			if(GetCommonDataDefault(NsIsReplay,true) == false)
			{
				SaveCommonDataEx(NsScore,savePathstage);
			}
			ClearCommonDataEx(NsScore);
			DeleteCommonData(NsGetSpell);
			DeleteCommonData(NsDefeatFrame);
			DeleteCommonData(NsDefeatPosX);
			DeleteCommonData(NsDefeatPosY);
			DeleteCommonData(NsBossFrame);
			DeleteCommonData(NsIsReplay);
		}
		let bgAngle=90;
		let BossAdjust=0;
		@BackGround {
		if(StageState!=Menu && BGDrawing==1)
		{

			if(StageProgress==1)
			{
				SetTexture(csd~"img\st1bg1.png");		//画像の貼り付け
			//	SetGraphicRect(0 + bgX, 0+bgY  ,4800 + bgX, 6000+ bgY);	//描画矩形の設定
				SetGraphicRect(0+bgX, 0+bgY  ,2400+bgX, 3000 + bgY);	//描画矩形の設定
				SetGraphicAngle(-75, 0, 0);
				SetGraphicScale(1,1);
			//	SetGraphicScale(0.25,0.25);
			SetAlpha(stage1alpha1);
				SetViewTo(0,-60,50);
				SetViewFrom(500,90,45);
				SetColor(200,200,255);
				SetRenderState(ALPHA);
				DrawGraphic3D(0, 0, -300);				//実際に表示

				SetFog(200,500,200,200,250);
				SetTexture(csd~"img\st1bg1.png");		//画像の貼り付け
			//	SetGraphicRect(0-bgX2, 0+bgY2  ,4800-bgX2, 6000 + bgY2);	//描画矩形の設定
				SetGraphicRect(0-bgX2, 0+bgY2  ,2400-bgX2, 3000 + bgY2);	//描画矩形の設定				//実際に表示
				SetGraphicAngle(-75, 0, 0);
				SetGraphicScale(1,1);
			//	SetGraphicScale(0.25,0.25);
			SetAlpha(stage1alpha2);
				SetViewTo(0,-60,50);
				SetViewFrom(500,90,45);
				SetColor(200,200,255);
				SetRenderState(ALPHA);
				DrawGraphic3D(0,0, -300);


				SetViewFrom(600+ViewFromX,90,40+BossAdjust);
				SetFog(200,500,200,200,250);

			if(stage1alpha3>0)
			{
				SetTexture(csd~"img\cloud.png");		//画像の貼り付け
			//	SetGraphicRect(0, 0+bgY2  ,2400, 3000 + bgY2);	//描画矩形の設定
				SetGraphicRect(0, 0+bgY3  ,2400, 3000 + bgY3);	//描画矩形の設定
				SetGraphicAngle(-75, 0, 0);
				SetGraphicScale(1,1);
			//	SetGraphicScale(0.25,0.25);
				SetAlpha(stage1alpha3);
				SetRenderState(ALPHA);
				SetViewTo(0,-60,50);
				SetColor(255,255,255);
				DrawGraphic3D(0,0, 0);
			}

			}
		}	
	}

task BGGraphicRect
{
	stage1alpha3=0;
	descent(let i in 0..300)
	{
		if(stage1alpha1<=80)
		{
			stage1alpha1+=80/60;
		}
		if(stage1alpha2<=120)
		{
			stage1alpha2+=120/60;
		}
		if(stage1alpha3<=80)
		{
			stage1alpha3+=40/60;
		}
			if (bgX >= 640)
			{
				bgX = 0;
			}
			if (bgY >= 480)
			{
				bgY = 0;
			}

			if (bgX2 >= 640)
			{
				bgX2 = 0;
			}
			if (bgY2 >= 480)
			{
				bgY2 = 0;
			}
			if (bgY3 >= 512)
			{
				bgY3 = 0;
			}
		if(ViewFromX>0)
		{
			ViewFromX-=300/240;
		}
	bgX += 0.5;
	bgY += 1+12*i/300;
	bgX2 += 0.5;
	bgY2 += 1+12*i/300;
	bgY3 += 1+12*i/300;
	yield;
	}
	stage1scale3=1;	while(StageProgress==1)
	{
			if (bgX >= 640)
			{
				bgX = 0;
			}
			if (bgY >= 480)
			{
				bgY = 0;
			}

			if (bgX2 >= 640)
			{
				bgX2 = 0;
			}
			if (bgY2 >= 480)
			{
				bgY2 = 0;
			}
			if (bgY3 >= 512)
			{
				bgY3 = 0;
			}
			if(GetCommonDataDefault("STAGE1MIDBOSS",false))
			{
				if(StageProgress==1)
				{
				bgX += 0.5;
				bgY += 1;
				bgX2 += 0.5;
				bgY2 += 1;
				bgY3 += 1;
				}
				if(BossAdjust>-15)
				{
					BossAdjust-=0.1;
				}
			}
			else if(GetCommonDataDefault("STAGE1BOSS",false))
			{
				bgX += 0.5;
				bgY += 1;
				bgX2 += 0.5;
				bgY2 += 1;
				bgY3 += 1;
				if(ViewFromX<100)
				{
				ViewFromX+=100/120;
				}
				if(BossAdjust>-15)
				{
					BossAdjust-=0.1;
				}
			}	
			else 
			{
				bgX += 0.5;
				bgY += 2;
				bgX2 += 0.5;
				bgY2 += 2;
				bgY3 += 2;
				if(BossAdjust<0)
				{
				BossAdjust+=0.1;
				}
			}
		if(StageChange){break;}
		yield;
	}

	while(StageChange)
	{
			if (bgX >= 640)
			{
				bgX = 0;
			}
			if (bgY >= 480)
			{
				bgY = 0;
			}

			if (bgX2 >= 640)
			{
				bgX2 = 0;
			}
			if (bgY2 >= 480)
			{
				bgY2 = 0;
			}
			if (bgY3 >= 512)
			{
				bgY3 = 0;
			}
			bgX += 0.5;
			bgY += 1;
			bgX2 += 0.5;
			bgY2 += 1;
			bgY3 += 1;
		if(stage1alpha1>0)
		{
			stage1alpha1-=80/240;
		}
		if(stage1alpha2>0)
		{
			stage1alpha2-=120/240;
		}
		yield;
	}

	while(StageProgress==2)
	{
		if(stage2alpha<=150)
		{
			stage2alpha+=150/240;
		}
			bgX += 1;
			if (bgX >= 6000)
			{
				bgX = 0;
			}
			bgX2 += 1;
			if (bgX >= 6000)
			{
				bgX2 = 0;
			}
				bgrt += 1;
				if(bgrt > 512){bgrt = bgrt - 512;}
				if(bgrt <   0){bgrt = bgrt + 512;}
		yield;
	}
	while(StageProgress==3)
	{
		if(stage3alpha<=150)
		{
			stage3alpha+=150/240;
		}
			bgX += 1;
			if (bgX >= 6000)
			{
				bgX = 0;
			}
			bgX2 += 1;
			if (bgX >= 6000)
			{
				bgX2 = 0;
			}
				bgrt += 1;
				if(bgrt > 512){bgrt = bgrt - 512;}
				if(bgrt <   0){bgrt = bgrt + 512;}
		yield;
	}

	while(StageProgress==4)
	{
			bgX += 1;
			if (bgX >= 6000)
			{
				bgX = 0;
			}
			bgX2 += 1;
			if (bgX >= 6000)
			{
				bgX2 = 0;
			}
				bgrt += 1;
				if(bgrt > 512){bgrt = bgrt - 512;}
				if(bgrt <   0){bgrt = bgrt + 512;}
		yield;
	}
	while(StageProgress==5)
	{
		if(stage5alpha1<=100)
		{
			stage5alpha1+=100/240;
		}
		if(stage5alpha2<=150)
		{
			stage5alpha2+=150/240;
		}
			bgX += 1;
			if (bgX >= 6000)
			{
				bgX = 0;
			}
			bgX2 += 1;
			if (bgX >= 6000)
			{
				bgX2 = 0;
			}
				bgrt += 1;
				if(bgrt > 512){bgrt = bgrt - 512;}
				if(bgrt <   0){bgrt = bgrt + 512;}
		yield;
	}
	while(StageProgress>=6)
	{
		if(stage6alpha1<=120)
		{
			stage6alpha1+=120/240;
		}
		if(stage6alpha2<=80)
		{
			stage6alpha2+=80/240;
		}
			bgX += 1;
			if (bgX >= 6000)
			{
				bgX = 0;
			}
			bgX2 += 1;
			if (bgX >= 6000)
			{
				bgX2 = 0;
			}
				bgrt += 1;
				if(bgrt > 512){bgrt = bgrt - 512;}
				if(bgrt <   0){bgrt = bgrt + 512;}
		yield;
	}
}

	task BGStage1MidBossEnd
	{
	while(stage1alpha3>0)
	{
		stage1alpha3-=80/2000;
		yield;
	}
	}

	task Stage1End
	{

	}

task DeleteUsedFile//もう使わないファイルをメモリから削除
{
	DeleteGraphic(csd ~ "img\spellname.png");//もう使わないから破棄
	DeleteGraphic(imgBG);//もう使わないから破棄
	wait(10);
	DeleteSE(MenuSE[0]);//もう使わないから破棄
	DeleteSE(MenuSE[1]);//もう使わないから破棄
	wait(900);
	DeleteGraphic(imgMenuEffect);//もう使わないから破棄
}	
///////////////////////////////////////////////////////////////////////////////////////
////////////////////////////ステージエフェクト、残機調整部////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
task MenuEffect//タイトル画面の紅葉を表示する
{
let RotateAngle;
let Scale;
let Alpha;
let YRandamColor;
loop
{
if(StageState==Menu)
{
	RotateAngle=rand(2,5);
	Scale=rand(0.2,1);
	Alpha=rand(100,200);
	YRandamColor=rand(0,50);
	EffectMomiji(RotateAngle,Scale,Alpha,YRandamColor);
}
	wait(5);

	if(StageProgress>=2)
	{
		break;
	}
}
}

task EffectMomiji(RotateAngle,Scale,Alpha,YRandamColor)//紅葉の設定
{
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgMenuEffect);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -15, -15);
		ObjEffect_SetVertexXY(obj, 1, 15,  -15);
		ObjEffect_SetVertexXY(obj, 2, 15, 15);
		ObjEffect_SetVertexXY(obj, 3,  -15,  15);
		
		ObjEffect_SetVertexUV(obj, 0,  2,  24);
		ObjEffect_SetVertexUV(obj, 1,  32, 24);
		ObjEffect_SetVertexUV(obj, 2, 32,  55);
		ObjEffect_SetVertexUV(obj, 3, 2, 55);
		ObjEffect_SetLayer(obj,8);
		ObjEffect_SetScale(obj, Scale,Scale);


		ObjEffect_SetVertexColor(obj,0,Alpha,255,50+YRandamColor,50);
		ObjEffect_SetVertexColor(obj,1,Alpha,255,50+YRandamColor,50);
		ObjEffect_SetVertexColor(obj,2,Alpha,255,50+YRandamColor,50);
		ObjEffect_SetVertexColor(obj,3,Alpha,255,50+YRandamColor,50);
		
		let speed=rand(1,2);
		Obj_SetPosition(obj,rand(GetClipMinX-64,GetClipMaxX+256),GetClipMinY-16);
		Obj_SetSpeed(obj,speed);
		Obj_SetAngle(obj,rand(80,100));
		let Zangle=rand(0,360);
		let dir=rand_int(0,1)*2-1;
		while(!Obj_BeDeleted(obj))
		{
			ObjEffect_SetAngle(obj,0,0,Zangle);
			Zangle+=RotateAngle*dir;
			Obj_SetSpeed(obj,speed);
			yield;
			if(Obj_GetY(obj)>GetClipMaxY+128)
			{
				Obj_Delete(obj);
			}
			if(StageState!=Menu)
			{
				ObjEffect_SetVertexColor(obj,0,Alpha,255,50+YRandamColor,50);
				ObjEffect_SetVertexColor(obj,1,Alpha,255,50+YRandamColor,50);
				ObjEffect_SetVertexColor(obj,2,Alpha,255,50+YRandamColor,50);
				ObjEffect_SetVertexColor(obj,3,Alpha,255,50+YRandamColor,50);
				Alpha-=5;
			}
		}
}

sub LifeAndBombDefine//初期の残機とボムを設定（専用自機だから別にいらないが）
{
	while(GetPlayerLife<3)
	{
		ExtendPlayer(1);
	}
	while(GetPlayerBomb<3)
	{
		AddBomb(1);
	}
	while(GetPlayerLife>3)
	{
		ExtendPlayer(-1);
	}
	while(GetPlayerBomb>3)
	{
		AddBomb(-1);
	}
}

sub StageTitleDisplay//メニュー画面の表示、SecretSpell部分でも呼び出して再起している。
{
			SetCommonData("TitleMenu",true);
			loop
			{
				alternative(StageState)	
				case(Menu)
				{
					TASK_MENU;
		 		}
				case(Exit)
				{
					break;
		 		}
				others{}
			yield;
			}

			ForbidShot(false);
			SetCommonData("TitleMenu",false);


			ForbidBomb(false);
}

task ExtendSystem//エクステンドの設定
{
	while(ScoreNumber2<250){yield;}
	ExtendPlayer(1);
	PlaySE("se\se1UP.wav");
	while(ScoreNumber2<500){yield;}
	ExtendPlayer(1);
	PlaySE("se\se1UP.wav");
	while(ScoreNumber2<1000){yield;}
	ExtendPlayer(1);
	PlaySE("se\se1UP.wav");
	while(ScoreNumber2<2000){yield;}
	ExtendPlayer(1);
	PlaySE("se\se1UP.wav");
	while(ScoreNumber2<4000){yield;}
	ExtendPlayer(1);
	PlaySE("se\se1UP.wav");
	while(ScoreNumber2<7500){yield;}
	ExtendPlayer(1);
	PlaySE("se\se1UP.wav");
	while(ScoreNumber2<10000){yield;}
	ExtendPlayer(1);
	PlaySE("se\se1UP.wav");
}

task TimeBonus
{
let x=GetCenterX;
let y=GetCenterY-64;
loop
{
	if(GetCommonDataDefault("TimeBonus",0)>0)
	{
		let BossRate=GetCommonDataDefault("BossRate",0);
	//	BossRate=1000;
		let Rate=GetCommonDataDefault("TimeBonus",0)*100000;
	//	Rate=23456;
		let MagicCounter=GetCommonData("MAGICCOUNTER");
		AddScore(BossRate*Rate*MagicCounter/100000);
		ascent(let i in 0..30)
		{
		TimeBonusDisplay(x,y-40,255*i/30,255,255,255);
		BossRateNumDisplay(x-40,y,BossRate,255*i/30,255,255,255);
		TimeBonusNumDisplay(x+60,y,Rate,255*i/30,255,255,255);
		KakeruDisplay(x-20,y,255*i/30,255,255,255);
		PercentDisplay(x+80,y,255*i/30,255,255,255);
		y-=0.2;
		yield;
		}
		loop(60)
		{
		TimeBonusDisplay(x,y-40,255,255,255,255);
		BossRateNumDisplay(x-40,y,BossRate,255,255,255,255);
		TimeBonusNumDisplay(x+60,y,Rate,255,255,255,255);
		KakeruDisplay(x-20,y,255,255,255,255);
		PercentDisplay(x+80,y,255,255,255,255);
		y-=0.2;
		yield;

		}	
		descent(let i in 0..30)
		{
		TimeBonusDisplay(x,y-40,255*i/30,255,255,255);
		BossRateNumDisplay(x-40,y,BossRate,255*i/30,255,255,255);
		TimeBonusNumDisplay(x+60,y,Rate,255*i/30,255,255,255);
		KakeruDisplay(x-20,y,255*i/30,255,255,255);
		PercentDisplay(x+80,y,255*i/30,255,255,255);
		y-=0.2;
		yield;
		}
	SetCommonData("TimeBonus",0);
	}
yield;
}
}

task TimeBonusDisplay(x,y,Alpha,R,G,B)//Apocalypseを表示
{
		let scx=0.4;
		let scy=0.4;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgStatusLetter);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	//	ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -201, -18);
		ObjEffect_SetVertexXY(obj, 1,201,  -18);
		ObjEffect_SetVertexXY(obj, 2,201, 18);
		ObjEffect_SetVertexXY(obj, 3,  -201,  18);
		
		ObjEffect_SetVertexUV(obj, 0,  12,  120);
		ObjEffect_SetVertexUV(obj, 1,  414, 120);
		ObjEffect_SetVertexUV(obj, 2, 414, 156);
		ObjEffect_SetVertexUV(obj, 3, 12, 156);

		ObjEffect_SetVertexColor(obj,0,Alpha,R,G,B);
		ObjEffect_SetVertexColor(obj,1,Alpha,R,G,B);
		ObjEffect_SetVertexColor(obj,2,Alpha,R,G,B);
		ObjEffect_SetVertexColor(obj,3,Alpha,R,G,B);

		ObjEffect_SetLayer(obj,7);
		Obj_SetPosition(obj,x,y+5);

		ObjEffect_SetScale(obj, scx,scy);

		yield;
		Obj_Delete(obj);
}
//////////////////////////////////////////////////////////
task StageStartEffect//ライフバーのバー部分の設定
{
	let BossLifeMax=GetEnemyLife;
	let scaleX=0;
	let scaleY=0;
	let MX=(GetClipMaxX-GetCenterX)/25;
	let MY=(GetClipMaxY-GetCenterY)/25;
	let ZAngle=90;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, csd~"img\sub.png");
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, SUBTRACT); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -512, -512);
		ObjEffect_SetVertexXY(obj, 1, 512,  -512);
		ObjEffect_SetVertexXY(obj, 2, 512, 512);
		ObjEffect_SetVertexXY(obj, 3, -512,  512);

		
		ObjEffect_SetVertexUV(obj, 0,  0,  0);
		ObjEffect_SetVertexUV(obj, 1,  1024, 0);
		ObjEffect_SetVertexUV(obj, 2, 1024,  1024);
		ObjEffect_SetVertexUV(obj, 3, 0, 1024);
		ObjEffect_SetLayer(obj,7);

		ascent(let i in 0..4)
		{
		ObjEffect_SetVertexColor(obj,i,255,255,255,255);
		}

		Obj_SetPosition(obj,GetCenterX,GetCenterY);
		ObjEffect_SetAngle(obj,0,0,ZAngle);

		loop(61)
		{
			ZAngle-=-90/60;
			scaleX+=MX/60;
			scaleY+=MY/60;
		//	ObjEffect_SetScale(obj, 1,1);
			ObjEffect_SetScale(obj, scaleX,scaleY);
			ObjEffect_SetAngle(obj,0,0,ZAngle);
			yield;
		}
		Obj_Delete(obj);
}
////////////////////////////////////////////////////////////////////////
////////////////////////エネミーライフ部////////////////////////////////
//////////////////////////////////////////////////////////////////////////

task EnemyLifeDisplay//下部に敵のライフを表示
{
loop
{
if(IsBossExisting==true && GetEnemyLife>1)
{
BossLifeBerDisplay;
BossLifeDisplay;
while(GetEnemyLife>1){yield}
}
yield;
}
}

task BossLifeBerDisplay//ライフバーの枠の設定
{
	let BossLifeMax=GetEnemyLife;
	let scale=2.5;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBer2);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -71, -8);
		ObjEffect_SetVertexXY(obj, 1, 71,  -8);
		ObjEffect_SetVertexXY(obj, 2, 71, 8);
		ObjEffect_SetVertexXY(obj, 3,  -71,  8);
		
		ObjEffect_SetVertexUV(obj, 0,  6,  11);
		ObjEffect_SetVertexUV(obj, 1,  148, 11);
		ObjEffect_SetVertexUV(obj, 2, 148,  21);
		ObjEffect_SetVertexUV(obj, 3, 6, 21);
		ObjEffect_SetLayer(obj,8);
		ObjEffect_SetScale(obj, 2.5,0.8);
		Obj_SetPosition(obj,GetCenterX,GetClipMaxY+8);

		while(GetEnemyLife>1)
		{
			if(GetCommonDataDefault("BOSSDEFEAT",false)){break;}
			yield;
		}
		loop(60)
		{
			ObjEffect_SetScale(obj, scale,0.8);
			scale-=2.5/60;
			yield;
		}
		SetCommonData("BOSSDEFEAT",false);
		Obj_Delete(obj);
}


task BossLifeDisplay//ライフバーのバー部分の設定
{
	let BossLifeMax=GetEnemyLife;
	let scale=2.5;

		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBer2);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, 0, -5);
		ObjEffect_SetVertexXY(obj, 1, 142,  -5);
		ObjEffect_SetVertexXY(obj, 2, 142, 5);
		ObjEffect_SetVertexXY(obj, 3,  0,  5);
		
		ObjEffect_SetVertexUV(obj, 0,  6,  27);
		ObjEffect_SetVertexUV(obj, 1,  148, 27);
		ObjEffect_SetVertexUV(obj, 2, 148,  33);
		ObjEffect_SetVertexUV(obj, 3, 6, 33);
		ObjEffect_SetLayer(obj,8);
		ObjEffect_SetScale(obj, scale,0.8);

		ascent(let i in 0..4)
		{
		ObjEffect_SetVertexColor(obj,i,120,255,200,255);
		}

		Obj_SetPosition(obj,GetCenterX-177,GetClipMaxY+8);

		while(GetEnemyLife>1)
		{
			scale=2.5*GetEnemyLife/BossLifeMax;
			ObjEffect_SetScale(obj, scale,0.8);
			yield;
		}
		Obj_Delete(obj);
}


/*
task EnemyLifeDisplay//下部に敵のライフを表示
{
loop
{

if(GetCommonDataDefault("STAGE1MIDBOSS",false))
{
wait(1);
BossLifeBerDisplay;
Stage1MidBossLifeDisplay;
while(IsBossExisting){yield;}
}

if(GetCommonDataDefault("STAGE1BOSS",false))
{
wait(1);
BossLifeBerDisplay;
Stage1BossLifeDisplay;
while(IsBossExisting){yield;}
}

yield;
}
}

task BossLifeBerDisplay//ライフバーの枠の設定
{
	let BossLifeMax=GetEnemyLife;
	let Scale=0;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBer2);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -0, -8);
		ObjEffect_SetVertexXY(obj, 1, 150,  -8);
		ObjEffect_SetVertexXY(obj, 2, 150, 8);
		ObjEffect_SetVertexXY(obj, 3,  -0,  8);
		
		ObjEffect_SetVertexUV(obj, 0,  6,  11);
		ObjEffect_SetVertexUV(obj, 1,  148, 11);
		ObjEffect_SetVertexUV(obj, 2, 148,  21);
		ObjEffect_SetVertexUV(obj, 3, 6, 21);
		ObjEffect_SetLayer(obj,8);

		Obj_SetPosition(obj,GetCenterX-186,GetClipMaxY+8);

		while(IsBossExisting)
		{
			ObjEffect_SetScale(obj, Scale,0.8);
			if(Scale<2.5)
			{
				Scale+=2.5/60;
			}
			if(GetCommonDataDefault("BOSSDEFEAT",false)){break;}
			yield;
		}
		loop(60)
		{
			ObjEffect_SetScale(obj, Scale,0.8);
			Scale-=2.5/60;
			yield;
		}
		SetCommonData("BOSSDEFEAT",false);
		Obj_Delete(obj);
}

task Stage1MidBossLifeDisplay//ライフバーのバー部分の設定
{
	let BossLifeMax=Stage1MidBoss1;
	let CurrentLife=BossLifeMax;
	let scale=0;
	let Scale=0;
		let obj = Obj_Create(OBJ_EFFECT);
		LifeBerObjSet(obj);

		while(IsBossExisting)
		{
			CurrentLife=GetEnemyLife;
			ObjEffect_SetScale(obj, scale,0.8);
			if(Scale<2.5)
			{
				Scale+=2.5/60;
			}
			scale=2.5*CurrentLife/BossLifeMax;
			if(Scale<scale)
			{
				scale=Scale;
			}
			if(GetCommonDataDefault("BOSSDEFEAT",false)){break;}
			yield;
		}
		Obj_Delete(obj);
}

task Stage1BossLifeDisplay//ライフバーのバー部分の設定
{
	let BossLifeMax=Stage1Boss1+Stage1Boss2;
	let CurrentLife=BossLifeMax;
	let scale=0;
	let Scale=0;
		let obj = Obj_Create(OBJ_EFFECT);
		LifeBerObjSet(obj);

		while(IsBossExisting)
		{
			CurrentLife=GetEnemyLife+Stage1Boss2;
			ObjEffect_SetScale(obj, scale,0.8);
			if(Scale<2.5)
			{
				Scale+=2.5/60;
			}
			scale=2.5*CurrentLife/BossLifeMax;
			if(Scale<scale)
			{
				scale=Scale;
			}
			yield;
		}
		Obj_Delete(obj);
}

////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////ライフバー共通部////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
function LifeBerObjSet(obj)
{
		ObjEffect_SetTexture(obj, imgBer2);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, 0, -5);
		ObjEffect_SetVertexXY(obj, 1, 150,  -5);
		ObjEffect_SetVertexXY(obj, 2, 150, 5);
		ObjEffect_SetVertexXY(obj, 3,  0,  5);
		
		ObjEffect_SetVertexUV(obj, 0,  6,  27);
		ObjEffect_SetVertexUV(obj, 1,  148, 27);
		ObjEffect_SetVertexUV(obj, 2, 148,  33);
		ObjEffect_SetVertexUV(obj, 3, 6, 33);
		ObjEffect_SetLayer(obj,8);

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

	//	Obj_SetPosition(obj,GetCenterX-177,GetClipMinY+10);
		Obj_SetPosition(obj,GetCenterX-186,GetClipMaxY+8);
}
*/
////////////////////////////////////////////////////////////////////////////////////////////
//////////////////時間計測、回数記録部,初期ボーナス部/////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
		task UpTimeCount//起動時間の計測
		{
			let UpTime=GetCommonDataDefaultEx(NsScore,NsUpTime,0);
			loop
			{
				UpTime++;
				SetCommonDataEx(NsScore,NsUpTime,UpTime);
				yield;
			}
		}

		task PlayTimeCount//プレイ時間の計測
		{
			let PlayTime=GetCommonDataDefaultEx(NsScore,NsPlayTime,0);
			loop
			{
				if(StageState!=Menu)
				{
				PlayTime++;
				}
				SetCommonDataEx(NsScore,NsPlayTime,PlayTime);
				yield;
			}
		}

		task PlayCharacterAndDifficult//プレイ回数を増やし初期霊点を決定する
		{
			alternative(SelectedDifficult)
			case("Moderate")
			{
				alternative(SelectedCharacter)
				case(DefinedPlayer1)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuAEasy,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuAEasy,Frequency);		
				}
				case(DefinedPlayer2)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuBEasy,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuBEasy,Frequency);		
				}
			}
			case("Extream")
			{
				alternative(SelectedCharacter)
				case(DefinedPlayer1)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuANormal,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuANormal,Frequency);		
				}
				case(DefinedPlayer2)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuBNormal,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuBNormal,Frequency);		
				}
			}
			case("Apocalypse")
			{
				alternative(SelectedCharacter)
				case(DefinedPlayer1)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuAHard,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuAHard,Frequency);		
				}
				case(DefinedPlayer2)
				{
					let Frequency=GetCommonDataDefaultEx(NsScore,NsFrequencyReimuBHard,0);
					Frequency++;
					SetCommonDataEx(NsScore,NsFrequencyReimuBHard,Frequency);		
				}
			}
			SetCommonData("SELECTEDDIFFICULT",SelectedDifficult);//選択難易度を受け渡すため保存
		}
/////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////ステータス表示部//////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
task DifficultDisplay//難易度を表示
{
	alternative(SelectedDifficult)
	case("Moderate")
	{
		ascent(let i in 0..60)
		{
		ModerateDisplay(530,20,255*i/60,255,255,255);
		yield;
		}
		loop{
		ModerateDisplay(530,20,255,255,255,255);
		yield;
		}
	}
	case("Extream")
	{
		ascent(let i in 0..60)
		{
		ExtreamDisplay(530,20,255*i/60,255,255,255);
		yield;
		}
		loop{
		ExtreamDisplay(530,20,255,255,255,255);
		yield;
		}
	}
	case("Apocalypse")
	{
		ascent(let i in 0..60)
		{
		ApocalypseDisplay(530,20,255*i/60,255,255,255);
		yield;
		}
		loop{
		ApocalypseDisplay(530,20,255,255,255,255);
		yield;
		}
	}
}

task StatusDisplay//Hiscoreから霊点までの文字を表示
{
loop
{
		StatusHighScoreDisplay(530,60,255,255,255,255);
		StatusScoreDisplay(530,110,255,255,255,255);
		StatusMagicCounterDisplay(530,160,255,255,255,255);
		StatusEfficiencyDisplay(530,210,255,255,255,255);
		PercentDisplay(610,233,255,255,255,255);
		StatusPlayerDisplay(470,260,255,255,255,255);
		StatusBombDisplay(470,290,255,255,255,255);
		yield;

}
}

task PlayerAndBombDisplay//残機と残ボムを星で表示
{
let life;
let bomb;
loop
{
	life=GetPlayerLife-1;
	if(life>8)
	{
		life=8;
	}
	bomb=GetPlayerBomb;
	if(bomb>8)
	{
		bomb=8;
	}
	ascent(let i in 0..life)
	{
		DisPlayPlayerStar(i);
	}
	ascent(let i in 0..bomb)
	{
		DisPlayBombStar(i);
	}
		
yield;
}
}

task DisPlayPlayerStar(i)//残機を表示
{
		let scx=0.4;
		let scy=0.4;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgStatusLetter);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	//	ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -21, -18);
		ObjEffect_SetVertexXY(obj, 1,21,  -18);
		ObjEffect_SetVertexXY(obj, 2,21, 18);
		ObjEffect_SetVertexXY(obj, 3,  -21,  18);
		
		ObjEffect_SetVertexUV(obj, 0,  11,  167);
		ObjEffect_SetVertexUV(obj, 1,  53, 167);
		ObjEffect_SetVertexUV(obj, 2, 53, 207);
		ObjEffect_SetVertexUV(obj, 3, 11, 207);

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

		ObjEffect_SetLayer(obj,8);
		Obj_SetPosition(obj,GetClipMaxX+105+16*i,263);

		ObjEffect_SetScale(obj, scx,scy);

		yield;
		Obj_Delete(obj);
}

task DisPlayBombStar(i)//残ボムを表示
{
		let scx=0.4;
		let scy=0.4;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgStatusLetter);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	//	ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -21, -18);
		ObjEffect_SetVertexXY(obj, 1,21,  -18);
		ObjEffect_SetVertexXY(obj, 2,21, 18);
		ObjEffect_SetVertexXY(obj, 3,  -21,  18);
		
		ObjEffect_SetVertexUV(obj, 0,  11,  167);
		ObjEffect_SetVertexUV(obj, 1,  53, 167);
		ObjEffect_SetVertexUV(obj, 2, 53, 207);
		ObjEffect_SetVertexUV(obj, 3, 11, 207);

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

		ObjEffect_SetLayer(obj,8);
		Obj_SetPosition(obj,GetClipMaxX+105+16*i,293);

		ObjEffect_SetScale(obj, scx,scy);

		yield;
		Obj_Delete(obj);
}

task DisPlayScore//ハイスコアを呼び出し、ハイスコアと現スコアを表示
{
let EachHiScore=0;
let EachHiScore2=0;
	alternative(SelectedDifficult)
	case("Moderate")
	{
		alternative(SelectedCharacter)
		case(DefinedPlayer1)
		{
			EachHiScore=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAEasy[0],0);
			EachHiScore2=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAEasy2[0],0);
		}
		case(DefinedPlayer2)
		{
			EachHiScore=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBEasy[0],0);
			EachHiScore2=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBEasy2[0],0);
		}
	}
	case("Extream")
	{
		alternative(SelectedCharacter)
		case(DefinedPlayer1)
		{
			EachHiScore=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuANormal[0],0);
			EachHiScore2=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuANormal2[0],0);
		}
		case(DefinedPlayer2)
		{
			EachHiScore=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBNormal[0],0);
			EachHiScore2=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBNormal2[0],0);
		}
	}
	case("Apocalypse")
	{
		alternative(SelectedCharacter)
		case(DefinedPlayer1)
		{
			EachHiScore=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAHard[0],0);
			EachHiScore2=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuAHard2[0],0);
		}
		case(DefinedPlayer2)
		{
			EachHiScore=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBHard[0],0);
			EachHiScore2=GetCommonDataDefaultEx(NsScore,NsHiScoreReimuBHard2[0],0);
		}
	}
CreateScore(EachHiScore,EachHiScore2);

/*旧スコア表示　２０億以上に対応できない
loop
{
if(GetScore>=EachHiScore)
{
	EachHiScore=GetScore;
}

	DisPlayNumber(GetClipMaxX+210,GetClipMinY+42,NumToString(EachHiScore),0);
	DisPlayNumber(GetClipMaxX+210,GetClipMinY+72,GetScore,0);

yield;
}
*/
}

function CreateScore(let EachHiScore,let EachHiScore2)//GetScore関数から二つにわけた変数に記録し擬似的に桁を増やしている
{
	continucount;
loop
{
	ScoreNumber1+=GetScore;
	AddScore(-GetScore);

	loop(100)
	{
		if(ScoreNumber1>=1000000)
		{
			ScoreNumber2+=1;
			ScoreNumber1-=1000000;
		}
	}

/*	if(ScoreNumber2>=EachHiScore2)
	{
		EachHiScore2=ScoreNumber2;
	}
	if(ScoreNumber2>=EachHiScore2 && ScoreNumber1>=EachHiScore)
	{
		EachHiScore=ScoreNumber1;
	}
*/
	if(EachHiScore2>ScoreNumber2)
	{
	DisPlayScoreNumber(GetClipMaxX+190,GetClipMinY+67,EachHiScore,EachHiScore2);
	DisPlayScoreNumber2(GetClipMaxX+118,GetClipMinY+67,EachHiScore2,0);
	}
	else
	{
	DisPlayScoreNumber(GetClipMaxX+190,GetClipMinY+67,ScoreNumber1,ScoreNumber2);
	DisPlayScoreNumber2(GetClipMaxX+118,GetClipMinY+67,ScoreNumber2,0);
	}

	DisPlayScoreNumber(GetClipMaxX+190,GetClipMinY+117,ScoreNumber1,ScoreNumber2);
	DisPlayScoreNumber2(GetClipMaxX+118,GetClipMinY+117,ScoreNumber2,0);
yield;
}
}

task continucount//コンテしたらスコアを0にする
{
	while(Continued==false)
	{
		yield;
	}
	ScoreNumber2=0;
	ScoreNumber1=0;
}

//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////インクルード部////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
#include_function ".\txt/stagedata.txt"
#include_function ".\txt/StageMenuLetter.txt"
#include_function ".\txt/StatusLetter.txt"
#include_function ".\txt/hiscore.txt"
#include_function ".\txt/BossLife.txt"
#include_function ".\txt/MENU.txt"
#include_function ".\txt/MENUDRAW.txt"
#include_function ".\stage1/STAGE1.txt"
#include_function ".\stage2/STAGE2.txt"
#include_function ".\stage3/STAGE3.txt"
#include_function ".\stage4/STAGE4.txt"
#include_function ".\stage5/STAGE5.txt"
#include_function ".\stage6/STAGE6.txt"

}