SiPlus

Untitled

Dec 12th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. R.TeleportSplash = function(org)
  2. {
  3.     var allocated = R.AllocParticles(896), i, j, k, l = 0, p;
  4.     var dir = [], vel;
  5.     for (i = -16; i <= 15; i += 4)
  6.     {
  7.                 Con.Print(i + '\n'); // -16 -12 -8 -4 0 -16, wtf???
  8.         for (j = -16; j <= 15; j += 4) // this loops correctly
  9.         {
  10.             for (k = -24; k <= 31; k += 4)
  11.             {
  12.                 if (l >= allocated.length)
  13.                     return;
  14.                 p = R.particles[allocated[l++]];
  15.                 p.die = CL.state.time + 0.2 + Math.random() * 0.16;
  16.                 p.color = 7 + Math.floor(Math.random() * 8.0);
  17.                 p.type = R.ptype.slowgrav;
  18.                 dir[0] = j * 8.0;
  19.                 dir[1] = i * 8.0;
  20.                 dir[2] = k * 8.0;
  21.                 p.org = [
  22.                     org[0] + i + Math.random() * 4.0,
  23.                     org[1] + j + Math.random() * 4.0,
  24.                     org[2] + k + Math.random() * 4.0
  25.                 ];
  26.                 dir = Vec.Normalize(dir);
  27.                 vel = 50.0 + Math.random() * 64.0;
  28.                 p.vel = [dir[0] * vel, dir[1] * vel, dir[2] * vel];
  29.             }
  30.         }
  31.     }
  32. };
Advertisement
Add Comment
Please, Sign In to add comment