Skip to content

Instantly share code, notes, and snippets.

@memish
Created January 3, 2019 20:51
Show Gist options
  • Save memish/9de966432be3ecbb9d0ec5f231b7e9e9 to your computer and use it in GitHub Desktop.
Save memish/9de966432be3ecbb9d0ec5f231b7e9e9 to your computer and use it in GitHub Desktop.
int side2 = 200;
int x2 = 250;
int y2 = 300;
int fact = 2;
void setup(){
size(500,600);
frameRate(5);
drawRect(200, width/2, height/2);
}
void draw(){
if(side2>10){
side2 -= 10;
drawRect(side2, x2+fact, y2+fact);
drawRect(side2, x2-fact, y2-fact);
fact += 2;
}
}
public void drawRect(int side, int x, int y){
stroke(255,0,0);
noFill();
rect(x,y,side,side);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment