#東方弾幕風 #Title[Method32:多角形リング] #Text[多角形の弾の輪を作ります。 Created By Ratius] #Player[FREE] #BGM[] #PlayLevel[TEST] #ScriptVersion[2] script_enemy_main { let imgBoss="script\ExRumia\img\ExRumia.png"; let time = 0; @Initialize { SetY(-500); SetMovePosition02(GetCenterX,GetCenterY-100,1); SetText("Method32:多角形リング"); SetLife(4000); LoadGraphic(imgBoss); attack; } @MainLoop { SetCollisionA(GetCenterX,GetCenterY-150,32); yield; } task attack{ loop(120){yield;} loop{ SetPoligonShot(GetX,GetY,0.8,90,2,rand(0,360),6,4,RED04,10); loop(30){yield;} } } /*SetPoligonShot(引数:10) 多角形に展開される弾群を発射します。 x x座標 y y座標 sp 速度 ang 角度 ssp 弾群の広がる速度 sang 弾群の角度 edge 辺の数 num 1辺あたりの弾数 grp 弾画像 del 遅延時間 */ function SetPoligonShot(x, y, sp, ang, ssp, sang, edge, num, grp, del){ num = trunc(num); let sp_x = cos(ang)*sp; let sp_y = sin(ang)*sp; let c_x;let c_y; let c_vx; let c_vy; let c_ang; ascent(i in 0..edge){ c_ang = sang+360*(i/edge); c_x=sp_x + cos(c_ang)*ssp; c_y=sp_y + sin(c_ang)*ssp; c_vx = cos(c_ang+90+180/edge)*(2*sin(180/edge))*ssp/num; c_vy = sin(c_ang+90+180/edge)*(2*sin(180/edge))*ssp/num; ascent(j in 0..num){ CreateShot11(x, y, c_x+c_vx*j, c_y+c_vy*j, grp, del); } } } @DrawLoop { SetTexture(imgBoss); SetGraphicRect(0,0,64,64); DrawGraphic(GetX,GetY); } @Finalize { DeleteGraphic(imgBoss); } }