Hello. I'm trying to make a spell that releases Bills which explode into bullets. The bullets are large balls with 10 tiny balls which circle around each.
task MainTask {
Wait(60); //Time for the Boss to get in position
while(ObjEnemy_GetInfo(objBoss,INFO_LIFE) > 0){
let bomb = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 0, 90, DS_BILL_BLUE, 5); //Creates "Bombs"
ObjMove_SetDestAtFrame(bomb, GetPlayerX(), GetPlayerY(), 60); //Moves the "Bomb" to the Player's previous position
Wait(60); //Wait until the bomb gets in position
let thetaT = rand(0,36);
ascent(i in 0..10){
let bull = CreateShotA1(ObjMove_GetX(bomb), ObjMove_GetY(bomb), 4, thetaT+36*i, DS_BALL_M_A_SKY, 5); //Creates the "shrapnel"
ObjMove_SetAngularVelocity(bull, 0.45);
ascent(j in 0..10){
let orb = CreateShotA1(ObjMove_GetX(bull)+20*cos(36*i), ObjMove_GetY(bull)+20*sin(36*i), 0,36*j, DS_BALL_SS_SKY, 5); //Creates bullets that circle around the shrapnel
Orbit(bull,orb,36*j);
}
}
Obj_Delete(bomb); //Deletes the bomb
Wait(7);
}
}
task Orbit(bull,orb,ang) {
let tim = 0;
while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
ObjMove_SetPosition(orb,ObjMove_GetX(bull)+4.3*cos(ObjMove_GetAngle(bull))+20*cos(ang+tim), ObjMove_GetY(bull)+4.3*sin(ObjMove_GetAngle(bull))+20*sin(ang+tim)); //Keeps the bullets around the shrapnel
tim += 3; //Causes the bullets to rotate around the shrapnel
yield;
}
}
The problem I'm having is that tiny bullets keep appearing in the top-left corner. I think it's the SetPosition command in the Orbit task that's causing this, but I don't know how to fix it.
PS: I am VERY new to Danmakufu.