Advertisement
xeromino

squares

Nov 22nd, 2015
246
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.  
  16.     var rad = 100,
  17.         rad2 = rad*1.5,
  18.         cx = width/2,
  19.         cy = height/2;
  20.    
  21.     list.addPoly({
  22.         x: width/2,
  23.         y: height/2,
  24.         radius: [rad,0],
  25.         sides: 4,
  26.         rotation: [90,0]
  27.     });
  28.    
  29.     list.addPoly({
  30.         x: [-rad2,cx-rad/2],
  31.         y: cy,
  32.         radius: [rad2,rad/2],
  33.         sides: 4,
  34.         rotation: [0,90]
  35.     });
  36.    
  37.     list.addPoly({
  38.         x: cx,
  39.         y: [-rad2,cy-rad/2],
  40.         radius: [rad2,rad/2],
  41.         sides: 4,
  42.         rotation: [0,90]
  43.     });
  44.    
  45.     list.addPoly({
  46.         x: [width+rad2,cx+rad/2],
  47.         y: cy,
  48.         radius: [rad2,rad/2],
  49.         sides: 4,
  50.         rotation: [0,90]
  51.     });
  52.    
  53.     list.addPoly({
  54.         x: cx,
  55.         y: [height+rad2,cy+rad/2],
  56.         radius: [rad2,rad/2],
  57.         sides: 4,
  58.         rotation: [0,90]
  59.     });
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement