function stage1
	{
		function Wait(let frame)
		{
			loop(frame){yield};
		}
		function WaitForZeroEnemy()
		{
			while(GetEnemyNum() != 0){yield;}
		}	
		Wait(240);
                ten=0;
                loop(1){
                ten+=30;
		CreateEnemyFromFile(csd~"1面\Enemy06.txt",cx-10+ten,0,10,90,0);
		CreateEnemyFromFile(csd~"1面\Enemy07.txt",cx+10-ten,0,10,90,0);
                }
		Wait(30);
                ten=0;
                loop(3){
                ten+=30;
		CreateEnemyFromFile(csd~"1面\Enemy06.txt",cx+ten,-5,10,90,0);
		CreateEnemyFromFile(csd~"1面\Enemy07.txt",cx-ten,-5,10,90,0);
		Wait(5);
                }
		Wait(30);
                ten=0;
                loop(5){
                ten+=30;
		CreateEnemyFromFile(csd~"1面\Enemy06.txt",cx+30+ten,-10,10,90,0);
		CreateEnemyFromFile(csd~"1面\Enemy07.txt",cx-30-ten,-10,10,90,0);
		Wait(5);
                }
		Wait(30);
                ten=0;
                loop(3){
                ten+=30;
		CreateEnemyFromFile(csd~"1面\Enemy06.txt",cx+ten,-5,10,90,0);
		CreateEnemyFromFile(csd~"1面\Enemy07.txt",cx-ten,-5,10,90,0);
		Wait(5);
                }
		Wait(30);
                ten=0;
                loop(1){
                ten+=30;
		CreateEnemyFromFile(csd~"1面\Enemy06.txt",cx-10+ten,0,10,90,0);
		CreateEnemyFromFile(csd~"1面\Enemy07.txt",cx+10-ten,0,10,90,0);
                }


		Wait(240); 
                SetLifeZeroToAllEnemy();
		Wait(10);
		CreateEnemyBossFromFile(GetCurrentScriptDirectory~"惑霧.txt",cx+50,0,0,0,0);
                CreateEventFromScript("EventTest");
		Wait(1);
                SetLifeZeroToAllEnemy();
		WaitForZeroEnemy();
		Wait(60);

	}

script_event EventTest
	{
	let csd =GetCurrentScriptDirectory;
		@Initialize
		{
			LoadGraphic("script\img\kamea.png");
			LoadGraphic("script\img\nizib.png");
		}
		
		@MainLoop
		{
			SetChar(RIGHT,"script\img\kamea.png");   //右側キャラクタの画像を設定
			SetGraphicRect(RIGHT,1,1,315,300);      //右側キャラクタの表示画像矩形を設定
			MoveChar(LEFT,BACK);                    
			MoveChar(RIGHT,FRONT);
			Wait(30);
			TextOut("\c[RED]やっほー。");

			SetChar(LEFT,"script\img\nizib.png");     //左側キャラクタの画像を設定
			SetGraphicRect(LEFT,150,1,400,300);        //左側キャラクタの表示画像矩形を設定
			MoveChar(LEFT,FRONT);
			MoveChar(RIGHT,BACK);
			Wait(30);
                        FadeOutMusic(BGM1,20);
			TextOut("\c[BLUE]ん？");

			MoveChar(LEFT,BACK);
			MoveChar(RIGHT,FRONT);
			Wait(30);
			TextOut("\c[RED]これは、会話のテストだ。");
		
			MoveChar(LEFT,FRONT);
			MoveChar(RIGHT,BACK);
			Wait(30);
			TextOut("\c[BLUE]そうなの？");

			MoveChar(LEFT,BACK);
			MoveChar(RIGHT,FRONT);
			Wait(30);
			TextOut("\c[RED]ああ、だからここで会話も終わりだ。");

			End();
		}
		
		@Finalize
		{
			DeleteGraphic(".\img\nizi.png");
			DeleteGraphic(".\img\patyur.png");
		}
  }