#include_function".\GameData\SystemData\GameLocalData.txt";
#include_function".\GameData\SystemData\GameBackGroundSystem.txt";
#include_function".\GameData\SystemData\GameMainLoopSystem.txt";
#include_function".\GameData\SystemData\GameMemorySystem.txt";
#include_function".\GameData\SystemData\GameMusicSystem.txt";
#include_function".\GameData\SystemData\GameHighScoreSystem.txt";
#include_function".\GameData\SystemData\FunctionEffectObject.txt";
#include_function".\GameData\SystemData\FunctionItemObject.txt";
#include_function".\GameData\SystemData\DrawFrameRender.txt";
#include_function".\GameData\SystemData\DrawStageTelop.txt";
#include_function".\GameData\SystemData\DrawWarning.txt";
#include_function".\GameData\SystemData\DrawMultiplyCount.txt";
#include_function".\GameData\SystemData\SetBreakEffect.txt";
#include_function".\GameData\SystemData\StageResultSystem.txt";

#include_function".\GameData\SystemData\GameMenuSystem.txt";
#include_function".\GameData\StageData\Stage1.txt";
#include_function".\GameData\StageData\Stage2.txt";
#include_function".\GameData\StageData\Stage3.txt";
#include_function".\GameData\StageData\Stage4.txt";
#include_function".\GameData\StageData\Stage5.txt";
#include_function".\GameData\StageData\Stage6.txt";

#include_function".\GameData\StageData\StageEx1.txt";
#include_function".\GameData\StageData\StageEx2.txt";
#include_function".\GameData\StageData\StageEx3.txt";
#include_function".\GameData\StageData\StagePh.txt";

function ProjectInitialize
{
	SetRateScoreSystemEnable(false);
	SetDefaultStatusVisible(false);
	SetShotAutoDeleteClip(80,80,80,80);
	
	//CreateDebugWindow;
	
	if(!debug_mode){ExpertEx(false,0,3);}
	
	ascent(a in 0..length(tex)){LoadGraphic(tex[a]);}
	ascent(a in 0..length(se)){LoadSE(se[a]);}
	
	AddScore(1);
	
//	MemoryReset;
	MemoryLoad;
	
	SetCommonData("Score",score);
	SetCommonData("SinglePlayFlg",false);
	
	if(IsReplay){replayflg=true;}
	
	GameMainThread;
}




task GameMainThread
{
	yield;
	CreateEnemyFromFile(GetCurrentScriptDirectory~".\GameData\LibData\load_usershot.txt",0,0,0,0,0);
	yield;
	FrameRender;
	
	GameMenu;
	SetCommonData("PlayMode",gamemode);
	ItemBorderLine;
	
	alternative(menu_playstage)
	case(0)
	{
		if(tuning_continue){ExpertEx(false,99,3);}
		Stage1;
		
		if(area2_standby){Stage2;}
		if(area3_standby){Stage3;}
		if(unseenarea1_standby)
		{
			if(unseenarea1_flg){StageEx1;}
		}
		if(area4_standby){Stage4;}
		if(unseenarea2_standby)
		{
			if(unseenarea2_flg){StageEx2;}
		}
		if(area5_standby){Stage5;}
		if(area6_standby){Stage6;}
		if(unseenarea3_standby)
		{
			if(unseenarea3_flg){StageEx3;}
		}
	}
	case(1){Stage1;}
	case(2){Stage2;}
	case(3){Stage3;}
	case(4){Stage4;}
	case(5){Stage5;}
	case(6){Stage6;}
	case(7){StageEx1;}
	case(8){StageEx2;}
	case(9){StageEx3;}
	case(10){StagePh;}
	
	ClearStage;
}



function StageInit
{
	bg_eye_lookat=[0,0,0];
	
	bg_eye_viewfrom=[500,90,45];
	
	bg_perspectiveclip=[10,1500];
	
	bg_fog_perspectiveclip=[0,0];
	
	bg_vector3=[0,0,0];
	bg_pos=[0,0,0];
	
}



function ProjectFinalize
{
	Slow(0);
	AddScore(-GetScore);
	SetHighScore;
	MemorySave;
}