Advertisement
Guest User

Untitled

a guest
Mar 6th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. function wait(w) {
  2.     loop(w) {
  3.     yield;
  4.     }
  5. }
  6.  
  7. //Creates circle with n bullets. Other parameters are for the shot type.
  8. function circle(n,x,y,s,b,d) {
  9.     let r = 360 / n;
  10.     let dev = rand(0,r);
  11.     let a = 90 + dev;
  12.     loop(n) {
  13.     CreateShotA1(x,y,s,a,b,d);
  14.     yield;
  15.     a = a + r;
  16.     yield;
  17.     }
  18. }
  19.  
  20. //Creates a spread with n bullets at dir direction with a angle between bullets.
  21. function spread(n,x,y,s,b,d,dir,a) {
  22.     let a2 = a / n;
  23.     let dir1 = dir - (a / 2);
  24.     loop(n) {
  25.     CreateShotA1(x,y,s,dir1,b,d);
  26.         yield;
  27.     dir1 = dir1 + a2;
  28.     yield;
  29.     }
  30. }
  31.  
  32. //Creates a spiral pattern with n1 "arms" and n2 bullets in each arm, and distance between bullets "rs".
  33. function spiral(n1,n2,rs,x,y,s,b,d) {
  34.     let a1 = 360 / n1;
  35.     let dev = rand(0,a1);
  36.     let a2 = 90 + dev;
  37.     loop(n2) {
  38.     loop(n1) {
  39.         CreateShotA1(x,y,s,a2,b,d);
  40.         yield;
  41.         a2 = a2 + a1;
  42.         yield;
  43.         }
  44.     yield;
  45.     a2 = a2 + rs;
  46.     wait(3);
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement