#東方弾幕風 #Title[レーザーアヒャヒャ] #Text[避けてみなしゃい] #ScriptVersion[2] script_enemy_main { let imgBoss = "script\img\ExRumia.png"; let frame = 0; let angleBase = 90; let a = 90; let b = 90; let c = 180; let d = -90; let e = 0; let f = 10000; let g = 0; let h = 0; let i = 0; let j = 0; @Initialize { SetX(GetCenterX); SetY(GetClipMinY + 120); SetLife(10000); LoadGraphic(imgBoss); SetTexture(imgBoss); SetGraphicRect(0, 0, 63, 63); } @MainLoop { SetCollisionA(GetX, GetY, 24); SetCollisionB(GetX, GetY, 24); b = e; e += 1; frame++; if(frame != 0){ nway(angleBase, 1, 5, YELLOW01); angleBase += rand(1,360); a += rand(1,360) ; } if(frame >= 8){ loop(1){ g = rand(-200,200); h = rand(4,1); CreateShot01(GetCenterX + g, GetClipMinY , h, 90 , BLUE03, 0); } if(frame == 8){ loop(8){ CreateLaser01(GetX,GetY,3,b,150,10,BLUE01,0); b += 45; frame=0; } } } } @DrawLoop { DrawGraphic(GetX, GetY); } @Finalize { DeleteGraphic(imgBoss); } function nway(dir, way, span, color) { let radius = 100; let angle = dir - (way - 1) / 2 * span; loop(way) { let x = GetX + offsetX(radius, angle); let y = GetY + offsetY(radius, angle); angle += span; } } function offsetX(radius, angle) { return radius * cos(angle); } function offsetY(radius, angle) { return radius * sin(angle); } }