Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- R.TeleportSplash = function(org)
- {
- var allocated = R.AllocParticles(896), i, j, k, l = 0, p;
- var dir = [], vel;
- for (i = -16; i <= 15; i += 4)
- {
- Con.Print(i + '\n'); // -16 -12 -8 -4 0 -16, wtf???
- for (j = -16; j <= 15; j += 4) // this loops correctly
- {
- for (k = -24; k <= 31; k += 4)
- {
- if (l >= allocated.length)
- return;
- p = R.particles[allocated[l++]];
- p.die = CL.state.time + 0.2 + Math.random() * 0.16;
- p.color = 7 + Math.floor(Math.random() * 8.0);
- p.type = R.ptype.slowgrav;
- dir[0] = j * 8.0;
- dir[1] = i * 8.0;
- dir[2] = k * 8.0;
- p.org = [
- org[0] + i + Math.random() * 4.0,
- org[1] + j + Math.random() * 4.0,
- org[2] + k + Math.random() * 4.0
- ];
- dir = Vec.Normalize(dir);
- vel = 50.0 + Math.random() * 64.0;
- p.vel = [dir[0] * vel, dir[1] * vel, dir[2] * vel];
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment