Skip to content

Instantly share code, notes, and snippets.

@albertochiwas
Created September 13, 2016 02:26
Show Gist options
  • Save albertochiwas/90655662a0a87e17d908416e9e2c67c5 to your computer and use it in GitHub Desktop.
Save albertochiwas/90655662a0a87e17d908416e9e2c67c5 to your computer and use it in GitHub Desktop.
Primer ejercicio
var av = new Avatar(2);
av.scale(0.5);
var inc = +1;
var inicio = true;
var pausa = false;
var draw = function() {
background(255, 255, 0);
if (av.getAngle(1)===180) {
inc = -inc;
inicio = false;
}
if (inicio===false && av.getAngle(1)===0) {
inc = -inc;
}
av.rotate(1,inc);
av.rotate(3,-inc);
av.draw(mouseX,mouseY);
};
var mouseClicked = function() {
if ( pausa ) {
loop();
} else {
noLoop();
}
pausa = !pausa;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment