	#東方弾幕風
	#Title[氷精迷路「ラブ⑨ラビリンス-あたいったら天才ね！の巻-」]
	#Text[迷路っぽいなにか]
	#Image[]
	#ScriptVersion[2]
	#BGM[.\BGM3.mp3]
	#Player[FREE]
	script_enemy_main
	{
		let c01=0;
		let c02=0;
		let c03=0;
		let cx=GetCenterX();
		let cy=GetCenterY();
    		let angle=0;
		let angleBase = 90;
		let rad=50;
		@Initialize
		{
			CutIn(YOUMU, "氷精迷路「ラブ⑨ラビリンス-あたいったら天才ね！の巻-」", "", 0, 0, 0, 0);
			SetLife(4000);
			SetMovePosition02(cx,cy,50);
			SetTimer(30);
        		SetScore(4000000);
			SetGraphicRect(1,1,48,48);
			LoadGraphic("script\img\2127578.png");
		}
			
		@MainLoop
		{
			if(c01==60) {
			nway(angleBase+5,10,36,BLUE01,1,rad,140);
			rad+=5;
			angleBase+=5;
			c01=55;
			}
			
			

				SetCollisionA(GetX(),GetY(),32);
				SetCollisionB(GetX(),GetY(),24);
				if(rad==250){rad=50;}
				c01++;
		}

		@DrawLoop
		{
			
			SetTexture("script\img\2127578.png");
			DrawGraphic(GetX(),GetY());
		}
		
		@Finalize
		{
			loop(24) {
        		let x = GetX + rand(-64, 64);
       	 		let y = GetY + rand(-64, 64);
        		CreateItem(ITEM_SCORE, x, y);
			}
			DeleteGraphic("script\img\2127578.png");
			}
			 
			function nway(dir,way,span,color,mode,rad,i,) {
        		let radius=rad;
       			let angle=dir-(way-1)/2*span;

        		loop(way) {
            		let x=GetX+offsetX(radius,angle);
            		let y=GetY+offsetY(radius,angle);

			CreateShot01(x,y,4,angle+i,color,0);
			angle+=span;
			}
    		}

    		function offsetX(radius,angle){
        		return radius*cos(angle);
   			}

    		function offsetY(radius,angle){
        		return radius*sin(angle);
    			}

		}
	}
  
