Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGLC(glc) {
- glc.loop();
- // glc.size(400, 400);
- glc.setDuration(1);
- // glc.setFPS(20);
- glc.setMode('single');
- glc.setEasing(false);
- glc.styles.backgroundColor = "white";
- var list = glc.renderList,
- width = glc.w,
- height = glc.h,
- color = glc.color;
- function ant(xpos, ypos) {
- //upper/lower legs
- for(var i = 0; i<2; i++) {
- var rotator = list.addContainer({
- x: xpos,
- y: [ypos,ypos-80],
- rotation: [i ? 10 : -30,i ? -30 : 10]
- })
- for(var j = 0; j<2; j++) {
- list.addLine({
- parent: rotator,
- x0: -25,
- y0: j ? -25 : 25,
- x1: 25,
- y1: j ? 25 : -25,
- stroke: [i ? true : false, i ? false : true],
- lineWidth: 2
- })
- }
- }
- //center legs
- for(var i = 0; i<2; i++) {
- var centerRotator = list.addContainer({
- x: xpos,
- y: [ypos,ypos-80],
- rotation: [i ? -20 : 40, i ? 40 : -20]
- })
- list.addLine({
- parent: centerRotator,
- x0: -30,
- y0: 0,
- x1: 30,
- y1: 0,
- stroke: [i ? true : false, i ? false : true],
- lineWidth: 2
- })
- }
- //body
- for(var i = 0; i<3; i++){
- list.addCircle({
- x: xpos,
- y: [ypos+i*20-20,ypos+i*20-100],
- radius: 10
- })
- }
- //antennae
- for(var l = 0; l<2; l++) {
- list.addLine({
- x0: xpos,
- y0: [ypos-20, ypos - 100],
- x1: l ? xpos-10 : xpos+10,
- y1: [ypos - 45, ypos - 125],
- lineWidth: 1
- })
- }
- }
- for(var rows = -1; rows<8; rows++){
- for(var num = 1; num<5; num++){
- ant(num*80,rows*80);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment