Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wait(w) {
- loop(w) {
- yield;
- }
- }
- //Creates circle with n bullets. Other parameters are for the shot type.
- function circle(n,x,y,s,b,d) {
- let r = 360 / n;
- let dev = rand(0,r);
- let a = 90 + dev;
- loop(n) {
- CreateShotA1(x,y,s,a,b,d);
- yield;
- a = a + r;
- yield;
- }
- }
- //Creates a spread with n bullets at dir direction with a angle between bullets.
- function spread(n,x,y,s,b,d,dir,a) {
- let a2 = a / n;
- let dir1 = dir - (a / 2);
- loop(n) {
- CreateShotA1(x,y,s,dir1,b,d);
- yield;
- dir1 = dir1 + a2;
- yield;
- }
- }
- //Creates a spiral pattern with n1 "arms" and n2 bullets in each arm, and distance between bullets "rs".
- function spiral(n1,n2,rs,x,y,s,b,d) {
- let a1 = 360 / n1;
- let dev = rand(0,a1);
- let a2 = 90 + dev;
- loop(n2) {
- loop(n1) {
- CreateShotA1(x,y,s,a2,b,d);
- yield;
- a2 = a2 + a1;
- yield;
- }
- yield;
- a2 = a2 + rs;
- wait(3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement