Mohammad Rahat 10.2

since I didn’t really have a decent midterm, I just did something simple

class Rect {

color c;
int xpos;
int ypos;

Rect() {
c = color(255);
xpos = 100;
ypos = 50;
}

void display() {
fill(c);
rect(xpos, ypos, 200, 200);
}
}

Rect myRect;

void setup() {
background(0);
size(400, 400);
myRect = new Rect();
}

void draw() {
myRect.display();
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *