Fixing codes

This code allows Zoog to move around the screen with the mouse:

screen-shot-2016-09-14-at-2-18-28-pm

int width = 100;
int height = 100;

void setup() {
size(1920,1080);
smooth();
}

void draw() {
background(255);

ellipseMode(CENTER);
rectMode(CENTER);

stroke(0);
fill(175);
rect(mouseX,mouseY,20,100);
stroke(0);
fill(255);
ellipse(mouseX,mouseY-30,60,60);

fill(mouseX,0,mouseY);
ellipse(mouseX-19,mouseY-30,16,32);
ellipse(mouseX+19,mouseY-30,16,32);
stroke(0);
line(mouseX-10,mouseY+50,pmouseX-10,pmouseY+60);
line(mouseX+10,mouseY+50,pmouseX+10,pmouseY+60);
}

void print(){
print(“Take me to your leader!”);
}

This code makes circles appear exactly where the mouse is pressed:

screen-shot-2016-09-14-at-2-20-18-pm

void setup() {
size(200,200);
background(255);
}
void draw() {
}
void mousePressed() {
stroke(0);
fill(175);
rectMode(CENTER);
rect(mouseX,mouseY,16,16,20);
}
void keyPressed() {
background(255);
}

This code makes random color appear when the mouse is pressed, but they cease when the mouse is not pressed:

screen-shot-2016-09-14-at-2-22-12-pm

color RanColor;
boolean goCrazy;

void setup() {
size(300, 300);
RanColor = color(200, 10, 189);
}

void draw() {
background (RanColor);
if (goCrazy == true) {
RanColor = color(random(255), random(255), random(255));
}
}

void mousePressed() {
goCrazy = true;
}

void mouseReleased() {
goCrazy = false;
}

This code makes the circle move diagonal across the screen:

screen-shot-2016-09-14-at-2-23-26-pm

float circleX = 0;
float circleY = 100;
float ellipse = 50;

void setup() {
size(200,200);
}
void draw() {
background(255);
stroke(0);
fill(175);
ellipse(circleX,circleX,50,50);
circleX = circleX + 1;
}

This code constantly creates random colored ellipses:

screen-shot-2016-09-14-at-2-24-15-pm

float g;
float b;
float a;
float diam;
float x;
float y;
float r;
void setup() {
size(720,480);
background(0);
smooth();
}
void draw() {
// Fill all variables with random values
r = random(255);
g = random(255);
b = random(255);
a = random(255);
diam = random(20);
x = random(width);
y = random(height);
// Use values to draw an ellipse
noStroke();
fill(r,g,b,a);
ellipse(x,y,diam,a);
}

Advertisements

About nadiaparfait1

I am currently attending Alfred State college. My major is Digital Media and Animation. I create art that expresses my emotions and experiences, incorporated with the knowledge that I obtain from school.
This entry was posted in Non-Time Based and tagged , , . Bookmark the permalink.

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