Advertisement
xeromino

split3

Nov 21st, 2015
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.     // glc.playOnce();
  4.     glc.size(540, 540);
  5.     glc.setDuration(2);
  6.     glc.setFPS(40);
  7.     glc.setMode("single");
  8.     // glc.setEasing(false);
  9.    
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h;
  13.  
  14.     // your code goes here:
  15.     var rad = 75;
  16.     var col1 = "rgba(119,119,119,.5)", col2 = "#FCD300";
  17.    
  18.     list.addPoly({
  19.         x: width/2,
  20.         y: height/2,
  21.         sides:6,
  22.         rotation: [-90,0],
  23.         radius: [0,rad]
  24.     });
  25.    
  26.     var TWO_PI = Math.PI*2;
  27.     var d = width*.75;
  28.     var num = 10;
  29.    
  30.     for (var i=0; i<num; i++){
  31.         var destX = width/2 + Math.cos(TWO_PI/num*i)*d;
  32.         var destY = height/2 + Math.sin(TWO_PI/num*i)*d;
  33.         list.addPoly({
  34.             x: [width/2, destX],
  35.             y: [height/2, destY],
  36.             sides: 6,
  37.             rotation: [0,180],
  38.             radius: [rad,5],
  39.         });
  40.     }
  41.    
  42.     num = 10;
  43.    
  44.     for (var i=0; i<num; i++){
  45.         var destX = width/2 + Math.cos(TWO_PI/num*i)*(d);
  46.         var destY = height/2 + Math.sin(TWO_PI/num*i)*(d);
  47.         list.addPoly({
  48.             x: [width/2, destX],
  49.             y: [height/2, destY],
  50.             fillStyle: "white",
  51.             sides: 6,
  52.             rotation: [0,180],
  53.             radius: [rad*.8,3],
  54.         });
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement