Created
January 3, 2019 20:51
-
-
Save memish/9de966432be3ecbb9d0ec5f231b7e9e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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