Skip to content

Instantly share code, notes, and snippets.

@albertochiwas
Created May 31, 2017 02:10
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/b1c4e6fb3e16e22b7ffa7d8ac4dee04f to your computer and use it in GitHub Desktop.
Save albertochiwas/b1c4e6fb3e16e22b7ffa7d8ac4dee04f to your computer and use it in GitHub Desktop.
Ejemplo final curso Live Coding UACH Mayo 2017
var av = new Avatar(2);
var c1 = color(255, 0, 0);
var c2 = color(48, 60, 199);
var c = c1;
var ang = 1;
var mouseClicked = function() {
if ( c===c1 ) {
c = c2;
} else {
c = c1;
}
};
var draw = function() {
background(c);
if ( ang < 45 ) {
ang++;
} else {
av.rotate(2,1);
}
av.setAngle(1, ang);
av.draw(mouseX,mouseY);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment