This requires some fairly complex trigonometric calculations, as Sparen said. Worry not, I have the answer. I'll provide you two functions here:
function GetEllipticX(let bX, let xLength, let yLength, let gapAngle, let dispAngle){
return bX+xLength*cos(gapAngle)*cos(dispAngle)-yLength*sin(gapAngle)*sin(dispAngle);
}
function GetEllipticY(let bY, let xLength, let yLength, let gapAngle, let dispAngle){
return bY+xLength*cos(gapAngle)*sin(dispAngle)+yLength*sin(gapAngle)*cos(dispAngle);
}
You can use these to form an ellipse centered on the coordinates bX and bY, adjust its minimum and maximum radii with xLength and yLength, and also adjust the angular alignment of the ellipse itself with dispAngle. gapAngle is used to create the actual ellipse, akin to how you use "x+radius*cos(angle)" or "y+radius*sin(angle)". Applying these functions to your code, we would have:
let angle = 0; // Since we're offsetting the angle of the ellipse, the position of the first bullet should stay at 0 degrees to ensure it aims at the player.
let angle2 = GetAngleToPlayer(objBoss); // The angular alignment of the ellipse, aimed at the player.
let r = 100;
let r2 = 0;
loop(10){
loop(40){
let sX = GetEllipticX(GetBossX,r,r2,angle,angle2-90); // Utilizing the GetEllipticX function.
// As the ellipse is supposed to begin in a horizontal position, we subtract 90 from angle2.
let sY = GetEllipticY(GetBossY,r,r2,angle,angle2-90); // The GetEllipticY variant of the above.
let trueAngle = angle+(angle2-90); // Still, using the above offsets the actual angle of the bullet due to the rotation.
// We fix this by adding "angle2-90" back to the original angle.
let id = CreateShotA1(sX, sY, 1, trueAngle, 11, 10);
angle += 360/40;
}
r -= 10;
r2 += 10;
wait(2);
}
I hope that helps~