So the idea here is to have some bullets spew out some more bullets whenever they touch, and it works, but only when they touch the first time (ie when they spawn in) and then never again. I thought it was because a distance of less than or equal to 1 or 10 was too small, but tweaking that doesn't seem to help. Setting it to a high number like 80 or something will have them spawn more bullets for a while longer, but then once they exit that distance, even when they get close again, they won't do anything.
task Shoot{
wait(120);
let AngleTRed = 45;
let AngleTBlue = 135;
loop{
let objShotRed = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 3, AngleTRed, BUBBLE_RED, 5);
AngleTRed += rand(85,90);
Reflect(objShotRed);
let objShotBlue = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 3, AngleTBlue, BUBBLE_BLUE, 5);
AngleTBlue += rand(85,90);
Reflect(objShotBlue);
while(GetObjectDistance(objShotRed, objShotBlue) <= 10){
CreateShotA1(ObjMove_GetX(objShotRed), ObjMove_GetY(objShotRed), 1, rand(0,360), DOT_PURPLE, 5);
CreateShotA1(ObjMove_GetX(objShotBlue), ObjMove_GetY(objShotBlue), 1, rand(0,360), DOT_PURPLE, 5);
yield;
}
wait(300);
yield;
}
}
Also, bizarrely, setting up a variable like let Distance = GetObjectDistance(objShotBlue, objShotRed);
and then calling that in the while loop just makes the bubbles spew bullets 100% of the time? I mean, I can pretty easily just type out the full GetObjectDistance function, but it was just strange.