xxxxxxxxxx
27
// figure out how to update angle to rotate 1deg/frame
// then, move angle = 45; to the end of draw()
// what happens? how is this different from having it in setup()?
let angle;
function setup() {
createCanvas(400, 400);
colorMode(HSB);
angleMode(DEGREES);
rectMode(CENTER);
angle = 45;
}
function draw() {
background(20);
noStroke();
fill(100,0,80);
translate(200,200);
rotate(angle);
square(0,0,100);
angle = ?;
}
function mouseMoved() {
angle = angle + 5;
}