Skip to content

Instantly share code, notes, and snippets.

@drakeirving
Created January 10, 2018 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drakeirving/36aac5ad8ddcc504525a983d56a3e2ea to your computer and use it in GitHub Desktop.
Save drakeirving/36aac5ad8ddcc504525a983d56a3e2ea to your computer and use it in GitHub Desktop.
CreateShotWedgeA1
function CreateShotWedgeA1(x, y, rows, gap, speed, angle, graphic, row_delay, shot_delay){
let a = [];
ascent(i in 0..rows){
ascent(j in 0..(i+1)){
let shot = ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(shot, x + (j*gap - (i*gap)/2) * cos(angle+90), y + (j*gap - (i*gap)/2) * sin(angle+90));
ObjMove_SetSpeed(shot, speed);
ObjMove_SetAngle(shot, angle);
ObjShot_SetGraphic(shot, graphic);
ObjShot_SetDelay(shot, shot_delay);
task run(shot){
loop(i*row_delay){yield;}
if(!Obj_IsDeleted(shot)){
ObjShot_Regist(shot);
}
}
run(shot);
a = a ~ [shot];
}
}
return a;
}
// let wedge = CreateShotWedgeA1(192, 150, 5, 10, 3, 45, SHOT_RICE_RED, 6, 6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment