Skip to content

Instantly share code, notes, and snippets.

@albertochiwas
Created August 31, 2015 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertochiwas/39afb83da8db9097ea47 to your computer and use it in GitHub Desktop.
Save albertochiwas/39afb83da8db9097ea47 to your computer and use it in GitHub Desktop.
ENC paper demo
var pause = false;
noCursor();
smooth();
var clearBackground = function(r,g,b,a) {
fill(r,g,b,a);
noStroke();
rect(0,0,400,400);
};
var mouseClicked = function() {
if (pause) {
loop();
} else {
noLoop();
}
pause = !pause;
};
// BUG: av1.rotate(2,-90);
var av1 = new Avatar("panther");
var av2 = new Avatar("squirrel");
av1.rotate(1,45);
av1.rotate(3,-45);
av2.scale(0.6);
var draw = function() {
clearBackground(200,200,250,90);
for (var i=0; i<av2.Joints; i++) {
av2.rotate(i,random(-3,3));
}
av1.draw(350,mouseY-80);
av2.draw(mouseX,mouseY);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment