eriknau

25Days-22

Dec 22nd, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onGLC(glc) {
  2.     glc.loop();
  3.      glc.size(300, 300);
  4.      glc.setDuration(2);
  5. //     glc.setFPS(20);
  6. //     glc.setMode('single');
  7. //     glc.setEasing(false);
  8.     var list = glc.renderList,
  9.         width = glc.w,
  10.         height = glc.h,
  11.         color = glc.color;
  12.    
  13.     var headY = height/2, headX = width*.75;
  14.     var rotStart = 0,
  15.         rotEnd = 180;
  16.     var rotator = list.addContainer({
  17.         x: [headX-100,headX],
  18.         y: headY,
  19.         rotation: [rotStart,rotEnd]
  20.     })
  21.         list.addCircle({
  22.             parent: rotator,
  23.             x:0,
  24.             y:0,
  25.             radius:15,
  26.             fill: true
  27.         })
  28.         list.addLine({
  29.             parent:rotator,
  30.             x0:0,
  31.             y0:0,
  32.             x1:-30,
  33.             y1:70,
  34.             lineWidth:5
  35.         })
  36.          //legs
  37.         var legX1 = [0,-10], legX2 = [-30,-40];
  38.         for(var i = 0; i<2; i++) {
  39.             list.addLine({
  40.                 parent: rotator,
  41.                 x0: -30,
  42.                 y0: 70,
  43.                 x1: legX1[i],
  44.                 y1: [100,80],
  45.                 lineWidth: 2
  46.             })
  47.             list.addLine({
  48.                 parent: rotator,
  49.                 x0: legX1[i],
  50.                 y0: [100,80],
  51.                 x1: legX2[i],
  52.                 y1: [140,80],
  53.                 lineWidth: 2
  54.             })
  55.             list.addCircle({
  56.                 parent: rotator,
  57.                 x:legX2[i],
  58.                 y:[140,80],
  59.                 radius:5,
  60.                 fill: true
  61.             })
  62.         }
  63.         //arms
  64.         var armX1 = [30,25], armX2 = [45,40];
  65.         for(var i = 0; i<2; i++) {
  66.             var sub_rotator = list.addContainer({
  67.                 parent:rotator,
  68.                 x:-10,
  69.                 y:30,
  70.                 rotation: [0,110]
  71.                
  72.             })
  73.             list.addLine({
  74.                 parent: sub_rotator,
  75.                 x0: 0,
  76.                 y0: 0,
  77.                 x1: armX1[i],
  78.                 y1: -5,
  79.                 lineWidth: 2
  80.             })
  81.             list.addLine({
  82.                 parent: sub_rotator,
  83.                 x0: armX1[i],
  84.                 y0: -5,
  85.                 x1: armX2[i],
  86.                 y1: -25,
  87.                 lineWidth: 2
  88.             })
  89.             list.addCircle({
  90.                 parent: sub_rotator,
  91.                 x:armX2[i],
  92.                 y:-25,
  93.                 radius:3,
  94.                 fill: true
  95.             })
  96.         }
  97. }
Add Comment
Please, Sign In to add comment