xxxxxxxxxx
26
let earthRot = 0;
let earthRotspeed = 0.01;
let moonRot = 0;
let moonRotspeed = 0.009;
function setup() {
createCanvas(300, 300);
strokeWeight(0.7);
}
function draw() {
background("#EEEEEE");
earthRot += earthRotspeed;
moonRot += moonRotspeed;
fill("OrangeRed");
ellipse(width/2, height/2, 140, 140);
translate(width/2, height/2);
rotate(moonRot);
translate(-width/2, -height/2);
fill("LightSeaGreen");
ellipse(width/2, 230, 20, 20);
}