Thanks, it works!
that's what i made :
task Bullet(x, y, v, angle, graphic, delay,radius) {
let obj=Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, x, y);
Obj_SetAngle(obj, angle);
Obj_SetSpeed(obj, v);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay (obj, delay);
ObjShot_SetBombResist (obj, true);
let t = 0;
loop{
Obj_SetX(obj, 224 + cos(t)*radius );
Obj_SetY(obj, 240 + sin(t)*radius);
t+= 1;
yield;
}
}
Only, i founded problems while doing a circle. because if i call Bullet(x, y, v, angle, graphic, delay,radius) in a (for example) loop(
with angle += 360/8; the ring don't appear. And that is because the ring do what the obj says, so all 8 bullets go in
Obj_SetX(obj, 224 + cos(t)*radius );
Obj_SetY(obj, 240 + sin(t)*radius);
That define x,y of only 1 point. So, in order to make a ring of 8 bullets, i did:
loop(
{
Bullet(GetX, GetY, 0, angle, 188, 30,90);
angle += 360/8; wait(48);
}
where wait(48); is used to spawn the 8 bullets in a circle. The problem is that each bullets move when is spawned , so at the end i can't do 8 bullets with the same distance...some bullets are too near or too far from the others.
Do you know a way to correct this maybe?