Created
August 31, 2015 01:53
-
-
Save albertochiwas/39afb83da8db9097ea47 to your computer and use it in GitHub Desktop.
ENC paper demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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