Week 2 Tut­o­r­i­a­l

by YUBING WANG

// this is Week 2 Toturial homework // Try to let the line & rect move

  • Show Sketch
/**@peep sketchcode */
int x=0;
int y=0;
void setup() {
  size(200,200);
  frameRate(3);
}
 
void draw() {
background(25,150,250);//actually I don't know what the colour is
stroke(120,120,0);
line(50+x,50+y,150-x,150-y);
line(50+x,150-y,150-x,50+y);
noFill();
rectMode(CENTER);
rect(100,100,100-2*x,100-2*x);
stroke(120,120,0);
x++;
y++;
}

Comments

Nobody has said anything yet.