assignment 2

int num = 20;
int[] dx = new int[num];
int[] dy = new int[num];
void setup() {
size(300, 240);
for (int i = 0; i < num; i++) {
dx[i] = i * 5;
dy[i] = 12 + (i * 6);
}
}

void draw() {
background(0);
smooth();
for (int i = 0; i < num; i++) {
dx[i] = dx[i] + 1;
height=dx[i]-5;
width =dy[i]-10;
if (dx[i] > 100) {
dx[i] = -100;
}
rect(dx[i], dy[i],height,width);
}
}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s