#東方弾幕風
#Title[弾幕制作テスト]
#Text[両回転N-Way弾]
#Image[]
#ScriptVersion[2]
	
script_enemy_main
{
	let count;//弾を出す間隔を制御するための変数;
	let cx;//変数cxに真ん中の座標を代入;
	@Initialize
	{
		count=0;//弾を出す間隔を制御するための変数;
		cx=GetCenterX();//変数cxに真ん中の座標を代入;
		SetLife(100);//敵のライフを1000に
		SetDamageRate(10,0);
		SetGraphicRect(64,1,127,64);//描画元の矩形を(64,1)-(127,64)に設定
		LoadGraphic("script\img\ExRumia.png");//script\img\ExRumia.jpgをテクスチャに読みこみ
		SetMovePosition02(cx,60,60);//座標(cx,60)に60フレームで移動
		Shot1;
		Shot2;
		Shot3;
		Shot4;
		Shot5;
		Shot6;
		Shot7;
		Shot8;
		Shot9;
		Shot10;
		Shot11;
		Shot12;
		Shot13;
		Shot14;
		Shot15;
		Shot16;
		Shot17;
		Shot18;
	}
		
	@MainLoop
	{
		yield;
		SetCollisionA(GetX(),GetY(),32);//敵の座標に当たり判定を登録
		SetCollisionB(GetX(),GetY(),24);//敵の座標に当たり判定(体当たり用)を登録
		count++;//1フレーム毎にcountが1増加
	}
	task Shot1
	{
		let angle1=-10;
		loop{
			CreateShot01(GetX(),GetY(),5,angle1,BLUE23,0);
			angle1+=10;
		loop(4){yield;}
		}
	}
	task Shot2
	{
		let angle2=0;
		loop{
			CreateShot01(GetX(),GetY(),5,angle2,BLUE23,0);
			angle2+=10;
		loop(4){yield;}
		}
	}
	task Shot3
	{
		let angle3=10;
		loop{
			CreateShot01(GetX(),GetY(),5,angle3,BLUE23,0);
			angle3+=10;
		loop(4){yield;}
		}
	}
	task Shot4
	{
		let angle4=110;
		loop{
			CreateShot01(GetX(),GetY(),5,angle4,GREEN23,0);
			angle4+=10;
		loop(4){yield;}
		}
	}
	task Shot5
	{
		let angle5=120;
		loop{
			CreateShot01(GetX(),GetY(),5,angle5,GREEN23,0);
			angle5+=10;
		loop(4){yield;}
		}
	}
	task Shot6
	{
		let angle6=130;
		loop{
			CreateShot01(GetX(),GetY(),5,angle6,GREEN23,0);
			angle6+=10;
		loop(4){yield;}
		}
	}
	task Shot7
	{
		let angle7=230;
		loop{
			CreateShot01(GetX(),GetY(),5,angle7,RED23,0);
			angle7+=10;
		loop(4){yield;}
		}
	}
	task Shot8
	{
		let angle8=240;
		loop{
			CreateShot01(GetX(),GetY(),5,angle8,RED23,0);
			angle8+=10;
		loop(4){yield;}
		}
	}
	task Shot9
	{
		let angle9=250;
		loop{
			CreateShot01(GetX(),GetY(),5,angle9,RED23,0);
			angle9+=10;
		loop(4){yield;}
		}
	}
	task Shot10
	{
		let angle10=-10;
		loop{
			CreateShot01(GetX(),GetY(),5,angle10,BLUE23,0);
			angle10-=10;
		loop(4){yield;}
		}
	}
	task Shot11
	{
		let angle11=0;
		loop{
			CreateShot01(GetX(),GetY(),5,angle11,BLUE23,0);
			angle11-=10;
		loop(4){yield;}
		}
	}
	task Shot12
	{
		let angle12=10;
		loop{
			CreateShot01(GetX(),GetY(),5,angle12,BLUE23,0);
			angle12-=10;
		loop(4){yield;}
		}
	}
	task Shot13
	{
		let angle13=110;
		loop{
			CreateShot01(GetX(),GetY(),5,angle13,GREEN23,0);
			angle13-=10;
		loop(4){yield;}
		}
	}
	task Shot14
	{
		let angle14=120;
		loop{
			CreateShot01(GetX(),GetY(),5,angle14,GREEN23,0);
			angle14-=10;
		loop(4){yield;}
		}
	}
	task Shot15
	{
		let angle15=130;
		loop{
			CreateShot01(GetX(),GetY(),5,angle15,GREEN23,0);
			angle15-=10;
		loop(4){yield;}
		}
	}
	task Shot16
	{
		let angle16=230;
		loop{
			CreateShot01(GetX(),GetY(),5,angle16,RED23,0);
			angle16-=10;
		loop(4){yield;}
		}
	}
	task Shot17
	{
		let angle17=240;
		loop{
			CreateShot01(GetX(),GetY(),5,angle17,RED23,0);
			angle17-=10;
		loop(4){yield;}
		}
	}
	task Shot18
	{
		let angle18=250;
		loop{
			CreateShot01(GetX(),GetY(),5,angle18,RED23,0);
			angle18-=10;
		loop(4){yield;}
		}
	}
	@DrawLoop
	{
		SetTexture("script\img\ExRumia.png");//描画元テクスチャを設定
		DrawGraphic(GetX(),GetY())//敵の座標にExルーミアを描画;
	}
	
	@Finalize
	{
		DeleteGraphic("script\img\ExRumia.png");//読みこんだテクスチャを破棄
	}
}
