blah
It creates the bullet and then immediately after, checks if(!Obj_IsDeleted(obj&&ObjMove_GetSpeed(obj)==0)). Note that as it's written, it's checking if (obj&&ObjMove_GetSpeed(obj)==0) is deleted. Oops typo. Obviously there's some screwup in there somewhere and Obj_IsDeleted returns false and the decision goes through. Oops shot bullat.
Even if it was written properly, obviously the bullet isn't deleted right after it's shot so it skips straight to the next condition, and unless you started it at 0 speed, it would return false and not shoot the bullet. There is nothing after that since there are no loops. Putting an if statement in a task does not inherently loop the if statement per frame. What you want is
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
while(!Obj_IsDeleted(obj)){
if(ObjMove_GetSpeed(obj)==0){
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
}
yield;
}
}
Or better yet
task bullet(x,y,speed,angle,accel,maxspeed,graphic,delay){
let obj=CreateShotA1(x,y,speed,angle,graphic,delay);
ObjMove_SetAcceleration(obj,accel);
ObjMove_SetMaxSpeed(obj,maxspeed);
while(ObjMove_GetSpeed(obj) != 0){
yield;
}
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),2,90,DS_BALL_M_RED,30);
}
Since the former will keep firing extra bullets as long as the bullet speed is 0, if it somehow ends up that the bullet speed stays 0.