Advertisement
Guest User

Untitled

a guest
May 28th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. var numcols = 1600;
  2. var curcol = 0;
  3.  
  4. function flood()
  5. {
  6. var pts = [];
  7.  
  8. pts.push({x: curcol, y: 0});
  9. pts.push({x: curcol, y: 100});
  10. pts.push({x: curcol, y: 200});
  11. pts.push({x: curcol, y: 300});
  12. pts.push({x: curcol, y: 400});
  13. pts.push({x: curcol, y: 500});
  14. pts.push({x: curcol, y: 600});
  15. pts.push({x: curcol, y: 700});
  16.  
  17. curcol += 4;
  18. if(curcol >= numcols)
  19. {
  20. curcol = 0;
  21. setTimeout(flood, Math.floor(Math.random()*500));
  22. return;
  23. }
  24.  
  25. color = Math.floor(Math.random()*16777215).toString(16);
  26. socket.emit('update', { points: pts, color: color, id: 1 });
  27. flood();
  28. }
  29. flood();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement