Oh right object related stuff. I made a few creation functions that automatically set all the initial behaviors because typing out those Obj_SetPosition, Obj_SetSpeed, Obj_SetAngle, and all that gets annoying when you do it a lot.
ObjShot_Create(x, y, speed, angle, graphic, delay)
Creates a shot object while setting up all the initial values. It then returns the object ID so you can do manipulations with it later.
function ObjShot_Create(x, y, speed, angle, graphic, delay){
let obj = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, x, y);
Obj_SetSpeed(obj, speed);
Obj_SetAngle(obj, angle);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
return obj;
}
ObjLaser_Create(x, y, angle, length, width, graphic, delay)
Creates a laser object while setting up all the initial values. It then returns the object ID so you can do manipulations with it later.
function ObjLaser_Create(x, y, angle, length, width, graphic, delay){
let obj = Obj_Create(OBJ_LASER);
Obj_SetPosition(obj, x, y);
//Obj_SetSpeed is skipped because it is ignored by laser objects.
Obj_SetAngle(obj, angle);
ObjLaser_SetLength(obj, length);
ObjLaser_SetWidth(obj, width);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
return obj;
}
ObjSinuateLaser_Create(x, y, speed, angle, length, width, graphic, delay)
Creates a curvy laser object while setting up all the initial values. It then returns the object ID so you can do manipulations with it later.
function ObjSinuateLaser_Create(x, y, speed, angle, length, width, graphic, delay){
let obj = Obj_Create(OBJ_SINUATE_LASER);
Obj_SetPosition(obj, x, y);
Obj_SetSpeed(obj, speed);
Obj_SetAngle(obj, angle);
ObjSinuateLaser_SetLength(obj, length);
ObjSinuateLaser_SetWidth(obj, width);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
return obj;
}
EDIT: Fixed a few mistakes I just noticed. Was typing these from memory rather than copy-pasting.