var x;
var y;
var offset = 300;
function setup() {
createCanvas(640, 480);
ellipse (CENTER);
}
function draw() {
background (245,255,0);
fill (30,255,0);
noStroke();
var m = max (min(mouseX, 640), 0);
var size = m *100.0 / 200.0;
ellipse (10 + m *190.0 / 400.0, 200.0, size, size);
fill (0,0,255);
size = 350 - size;
ellipse(200 + m * 190.0/400.0, 200.0. size, size);
ellipse (10 + m *190.0 / 250.0, 200.0, size, size);
ellipse (40 + m *190.0 / 100.0, 150.0, size, size);
fill (240,70,20);
rect (40 + m *300.0 / 100.0, 150.0, size, size);
rect (50 + m *100.0 / 50.0, 70.0, size, size);
var line1 = map(mouseY, 100, 400, 76, 310);
stroke(240, 10, 150);
strokeWeight(10);
line(240, line1, 240, 311);
var line2 = map(mouseY, 100, 400, 76, 312);
stroke(240, 10, 150);
strokeWeight(10);
line(252, line1, 253, 313);
var line3 = map(200, mouseY, 400, 76, 310);
stroke(240, 10, 150);
strokeWeight(10);
line(240, line4, 240, 311);
var line4 = map(200, mouseY, 400, 76, 312);
stroke(240, 10, 150);
strokeWeight(10);
line(252, line2, 253, 313);
noStroke();
fill(255);
ellipse(mouseX, 100, 60, 60);
fill(0);
ellipse(width - mouseX, 200, 60, 60);
if (mouseX > x) {
x += 10;
offset = -10;
}
if (mouseX > x){
x -= -10;
offset = 10;
}
}
I tried to play with depth, rotation, and colors of objects in this assignment.