Yes, the bullets spawn in a 90? fan from right to left, and each one aims to the player independantly.
And, if i got right what you said, it should be something like this...
task fire1 {
let dir = 46;
loop {
loop(20) {
bullet(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3, BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}
}
task bullet(x, y, v, graphic, delay) {
let shot = Obj_Create(OBJ_SHOT);
let dir = atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX);
Obj_SetPosition(shot, x, y);
Obj_SetSpeed(shot, v);
Obj_SetAngle(shot, dir);
ObjShot_SetGraphic(shot, graphic);
ObjShot_SetDelay(shot, delay);
ObjShot_SetBombResist(shot, true);
}
Or this...
task fire1 {
let dir = 46;
loop {
loop(20) {
bullet(GetEnemyX+50*cos(dir), GetEnemyY+50*sin(dir), 3, BLUE01, 0);
dir+=90/20;
wait(5);
}
dir = 46;
wait(127);
yield;
}
}
task bullet(x, y, v, graphic, delay) {
let shot = Obj_Create(OBJ_SHOT);
Obj_SetPosition(shot, x, y);
Obj_SetSpeed(shot, v);
Obj_SetAngle(shot, atan2(Obj_GetY(shot) - GetPlayerY, Obj_GetX(shot) - GetPlayerX));
ObjShot_SetGraphic(shot, graphic);
ObjShot_SetDelay(shot, delay);
ObjShot_SetBombResist(shot, true);
}
However, the latter one aims at exactly 180? away from the player :V The former... meh
There's something i'm missing...