eriknau

Gif Loop Coder Hexaworms

Nov 23rd, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.     glc.styles.backgroundColor = "#000000";
  4.     // glc.playOnce();
  5.     // glc.size(400, 400);
  6.      glc.setDuration(5);
  7.     // glc.setFPS(20);
  8.     glc.setMode("bounce");
  9.     // glc.setEasing(false);
  10.     // glc.setMaxColors(256);
  11.     var list = glc.renderList,
  12.         width = glc.w,
  13.         height = glc.h;
  14.     var num = 22;
  15.  
  16.         for (var i = num; i > 0; i--) {
  17.         list.addPoly({
  18.             x: function(t) {
  19.                return 250 + Math.sin(t * Math.PI * 4) * 50;
  20.            },
  21.             y: [300,100],
  22.             stroke: true,
  23.             strokeStyle: "#ff0000",
  24.             lineWidth: 2,
  25.             radius: 4*(i+1),
  26.             sides: 6,
  27.             phase: 0.01*i
  28.         })
  29.     };
  30.         for (var i = num; i > 0; i--) {
  31.         list.addPoly({
  32.             x: function(t) {
  33.                return 150 + Math.sin(t * Math.PI * 2) * 100;
  34.            },
  35.             y: [250,350],
  36.             stroke: true,
  37.             strokeStyle: "#ff0000",
  38.             lineWidth: 2,
  39.             radius: 2*(i+1),
  40.             sides: 6,
  41.             phase: 0.02*i
  42.         })
  43.     };
  44.         for (var i = num; i > 0; i--) {
  45.         list.addPoly({
  46.             x: function(t) {
  47.                return 100 + Math.sin(t * Math.PI * 1) * 100;
  48.            },
  49.             y: [50,250],
  50.             stroke: true,
  51.             strokeStyle: "#ff0000",
  52.             lineWidth: 2,
  53.             radius: 2*(i+1),
  54.             sides: 6,
  55.             phase: 0.01*i
  56.         })
  57.     };
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment