()
| 18 | } |
| 19 | |
| 20 | function draw() { |
| 21 | background(255); // Draw a black background |
| 22 | |
| 23 | // mouseX position determines speed factor for moveZoog function |
| 24 | var factor = constrain(mouseX / 10, 0, 5); |
| 25 | |
| 26 | // The code for changing the variables associated with Zoog and displaying Zoog is moved outside of draw() and into functions called here. |
| 27 | // The functions are given arguments, such as “Jiggle Zoog by the following factor” and “draw Zoog with the following eye color. |
| 28 | jiggleZoog(factor); |
| 29 | // pass in a color to drawZoog |
| 30 | // function for eye's color |
| 31 | var d = dist(x, y, mouseX, mouseY); |
| 32 | var c = color(d); |
| 33 | drawZoog(c); |
| 34 | } |
| 35 | |
| 36 | function jiggleZoog(speed) { |
| 37 | // Change the x and y location of Zoog randomly |
nothing calls this directly
no test coverage detected