Advertisement
xeromino

split2

Nov 21st, 2015
195
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(30);
  7.     glc.setMode("single");
  8.     glc.styles.backgroundColor = "#202020";
  9.     // glc.setEasing(false);
  10.    
  11.     var list = glc.renderList,
  12.         width = glc.w,
  13.         height = glc.h;
  14.  
  15.     // your code goes here:
  16.     var rad = 75;
  17.     var col1 = "rgba(119,119,119,.5)", col2 = "#FCD300";
  18.    
  19.     list.addPoly({
  20.         x: width/2,
  21.         y: height/2,
  22.         sides:6,
  23.         rotation: [-90,0],
  24.         fillStyle: "darkgrey",
  25.         radius: [0,rad]
  26.     });
  27.    
  28.     var TWO_PI = Math.PI*2;
  29.     var d = width*.75;
  30.     var num = 10;
  31.    
  32.     for (var i=0; i<num; i++){
  33.         var destX = width/2 + Math.cos(TWO_PI/num*i)*d;
  34.         var destY = height/2 + Math.sin(TWO_PI/num*i)*d;
  35.         list.addPoly({
  36.             x: [width/2, destX],
  37.             y: [height/2, destY],
  38.             sides: 6,
  39.             rotation: [0,180],
  40.             radius: [rad,5],
  41.             fillStyle: [col1, col2]
  42.         });
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement