Advertisement
eriknau

wavers

Dec 23rd, 2015
115
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(400, 250);
  4.      glc.setDuration(1);
  5. //     glc.setFPS(25);
  6. //     glc.setMode('single');
  7. //     glc.setEasing(false);
  8. //    glc.setMaxColors(80);
  9.     glc.styles.backgroundColor = "white";
  10.     var list = glc.renderList,
  11.         width = glc.w,
  12.         height = glc.h,
  13.         color = glc.color;
  14.    
  15.     list.addRect({
  16.         x: 0,
  17.         y: 0,
  18.         w: width,
  19.         h: height,
  20.         drawFromCenter: false,
  21.         fillStyle: "lavender"
  22.     })
  23.     list.addRect({
  24.         x: 0,
  25.         y: 150,
  26.         w: width,
  27.         h: 100,
  28.         drawFromCenter: false,
  29.         fillStyle: "green"
  30.     })
  31.  
  32.     for(var i =1; i<11; i++) {
  33.         var yposStart = 100,
  34.             yposEnd = yposStart;
  35.         var jumper = list.addContainer({
  36.             x: i*35,
  37.             y: [yposStart,yposEnd],
  38.             phase: i*0.03
  39.         })
  40.        
  41.         list.addCircle({
  42.             parent: jumper,
  43.             x: 0,
  44.             y: 0,
  45.             radius: 10,
  46.             fill: true
  47.         })
  48.         list.addLine({
  49.             parent: jumper,
  50.             x0: 0,
  51.             y0: 0,
  52.             x1: 0,
  53.             y1: 60,
  54.             lineWidth: 3
  55.         })
  56.         list.addLine({
  57.             parent: jumper,
  58.             x0: 0,
  59.             y0: 60,
  60.             x1: -10,
  61.             y1: 120,
  62.             lineWidth: 2      
  63.         })
  64.         list.addLine({
  65.             parent: jumper,
  66.             x0: 0,
  67.             y0: 60,
  68.             x1: 10,
  69.             y1: 120,
  70.             lineWidth: 2      
  71.         })
  72.         var lArm = list.addContainer({
  73.             parent: jumper,
  74.             x: 0,
  75.             y: 15,
  76.             rotation: [0,140]
  77.         })
  78.         var rArm = list.addContainer({
  79.             parent: jumper,
  80.             x: 0,
  81.             y: 15,
  82.             rotation: [0,-140]
  83.         })
  84.         list.addLine({
  85.             parent: lArm,
  86.             x0: 0,
  87.             y0: 0,
  88.             x1: -5,
  89.             y1: 45,
  90.             lineWidth: 2
  91.         })
  92.         list.addLine({
  93.             parent: rArm,
  94.             x0: 0,
  95.             y0: 0,
  96.             x1: 5,
  97.             y1: 45,
  98.             lineWidth: 2
  99.         })
  100.     }  
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement