Created
August 29, 2016 19:33
-
-
Save albertochiwas/9047909530916113545f72e507c82276 to your computer and use it in GitHub Desktop.
Ardilla con mouseX mouseY en draw()
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 h1 = [25,25,25,0,0,0,0,0,0]; | |
var c1 = [0,0,0,0,25,25,-25,-25]; | |
var i = 0; | |
var avanza = +1; | |
frameRate(15); | |
var av = new Avatar(0); | |
av.scale(0.5); | |
var draw = function() { | |
background(255); | |
av.rotate(1,h1[i]*avanza); | |
av.rotate(2,c1[i]*avanza); | |
av.draw(mouseX,mouseY); | |
i = i + avanza; | |
if (i<0 || i >= h1.length) { | |
avanza = -avanza; | |
} | |
}; | |
var mouseClicked = function() { | |
noLoop(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment