#東方弾幕風 #Title[Method41:楕円] #Text[回転する楕円。 Created By ミレイ] #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("Method41:楕円"); SetLife(4000); LoadGraphic(imgBoss); attack; } @MainLoop { SetCollisionA(GetCenterX,GetCenterY-150,32); yield; } task attack{ let ang = 0; //射出方向 let ang2 = 0; //楕円の傾き loop(120){yield;} loop{ ang += 10; ang2 += 1; ascent(i in 0..3){ CreateSpiral(GetX, GetY, 3, ang+i*120, 120, 40, ang2, RED21, 25); CreateSpiral(GetX, GetY, 1.5, ang+i*120+90, 120, 40, ang2+90, YELLOW21, 25); } loop(4){yield;} } } function CreateSpiral(x, y, sp, ang, x2, y2, ang2, grp, del){ /* x 中心のX座標 y 中心のY座標 sp 弾速 ang 射出方向 x2 水平方向の軸の長さ y2 鉛直方向の軸の長さ ang2 楕円の傾き grp 弾グラフィック dl 遅延時間 */ let ux = cos(ang-ang2) * x2; //楕円の傾きが0の時のX座標 let uy = sin(ang-ang2) * y2; //楕円の傾きが0の時のY座標 let rx = x + cos(ang2) * ux - sin(ang2) * uy; let ry = y + sin(ang2) * ux + cos(ang2) * uy; CreateShot01(rx, ry, sp, ang, grp, del); } @DrawLoop { SetTexture(imgBoss); SetGraphicRect(0,0,64,64); DrawGraphic(GetX,GetY); } @Finalize { DeleteGraphic(imgBoss); } }