Hi there- I am currently trying to make an animation for homework for my coding class and I am having trouble. I have three separate squares on the screen, but I don’t know how to properly make them go at different times.
my code is posted here:
int startTime;
int x=3;
int x2=10;
int x3=20;
void setup() {
size(500, 500);
}
void draw() {
strokeWeight (400);
background(#FFFFFF);
stroke (263, 33,99, 10);
line (0, 0, 200, 510);
stroke (263, 33,99, 50);
line (150, 0, 370, 510);
stroke (263, 33,99, 150);
line (350, 0, 570, 500);
for (int i =0; i<5; i++) {
noStroke();
fill (8, 245, 255, 50);
rect(x+50*i,height/2,120,120);
}
x+=3;
for (int i =0; i<5; i++) {
noStroke();
fill (#D6FDFF);
rect (x2,height/2,50,50);
}
x2+=-5;
for (int i =0; i<5; i++) {
noStroke();
fill (#19ABB2);
rect (x2,height/2,80,80);
}
x3+=70;
}