HW 3.2 Part 3

int x = 100;
int speed = 7;

void setup() {
size (600, 600);
}

void draw() {
background(0);
noStroke();
fill(255, 0, 0);
ellipse(x, x, 200, 200);

if (x > width) {
speed = speed * -1;
}

else if (x < 0) {
speed = speed * -1;
}

x = x+speed;
}

void mousePressed(){
fill(0,225,0);
ellipse(x, x, 200, 200);
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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