Advertisement
Pvp_machine100

Untitled

Jan 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. var siny = Math.sin(((x + time / 17) * 4 * Math.PI) / width);
  2. // convert to range 0 to 1
  3. siny = (siny + 2) / 4;
  4. siny = siny * height;
  5.  
  6. var thickness = (Math.sin(time / 500) * 3 + 5);
  7. var dist = Math.min(Math.abs(y - siny) / thickness, 1);
  8.  
  9. return Math.floor((1 - dist) * 255);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement