Skip to content

Instantly share code, notes, and snippets.

@albertochiwas
Created August 27, 2015 17:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertochiwas/82b4866f4b3179f7fbf5 to your computer and use it in GitHub Desktop.
Save albertochiwas/82b4866f4b3179f7fbf5 to your computer and use it in GitHub Desktop.
Rotate each puppet joint randomly & pause with click mouse (to test constraints)
var av = new Avatar("squirrel");
var pause = false;
var draw = function() {
background(99);
for (var i=0; i<10; i++) {
av.rotate(i,random(-9,9));
}
av.draw(mouseX,mouseY);
};
var mouseClicked = function() {
if (pause) {
loop();
} else {
noLoop();
}
pause = !pause;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment