Created
September 13, 2016 02:26
-
-
Save albertochiwas/90655662a0a87e17d908416e9e2c67c5 to your computer and use it in GitHub Desktop.
Primer ejercicio
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 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