
#Title[cpおためしtask]
#Text[cpおためしtask]
//#BackGround[]
#PlayLevel[Nomal]
#ScriptVersion[2]

script_enemy_main {
		let imgBoss     = "script\img\ExRumia.png";
		let bgm			= ".\bgm\Rules.mp3";

		LoadMusic(bgm);
		PlayMusic(bgm);

    @Initialize {
		CutIn(YOUMU, "", "", 0, 0, 0, 0);
		
     	SetLife(3300);
        SetTimer(65);
        SetScore(3300);
        SetDamageRate(60, 5);

        LoadGraphic(imgBoss);
        SetTexture(imgBoss);
	Expert();
	SetAllowedContinueCount(0);

        main;
        whiteshot;
	}

	@MainLoop {
		SetCollisionA(GetX, GetY, 32);
		SetCollisionB(GetX, GetY, 16);

		yield;
	}

	@DrawLoop {
		//DrawGraphic(GetCenterX(), GetCenterY()-20);
	}

	@Finalize {
		DeleteEnemyShot(ALL);
		DeleteGraphic(imgBoss);
		DeleteMusic(bgm);
	}

	task main {
		let angle = -180;
		
		yield;
		loop {
			SetShotDirectionType(PLAYER);
			loop(1){yield;}
			CreateShot01(GetCenterX()+20,GetCenterY()-60,1,angle,PURPLE12,0);
			angle-=1;
			CreateShot01(GetCenterX()+20,GetCenterY()-60,1,-angle,PURPLE12,0);
			angle+=5;
			
		}	
	}

	task whiteshot {
		let cntA	= 60;
		yield;		
		loop {
		loop(60){yield;}
		SetShotDirectionType(PLAYER);
		loop(2){
			loop(24){
				CreateShot01((rand(GetClipMinX(),GetClipMaxX())),GetCenterY()-60,1,cntA,WHITE01,0);
				cntA+=15;
				}
			}
		}
	}
  }
}
}