Digital Landscape using Processing

Screen Shot 2015-09-29 at 1.40.38 PM

float weight = 6;
float sizeX = 20;
float sizeY = 20;
int r = 0;
int g = 0;
int b = 0;

void setup(){
background (255);
size (780, 460);
stroke (1);
}

void draw(){
if (mousePressed && mouseButton == LEFT){
if (mouseX >= -30 && mouseX <= 800){
if (mouseY >= -30 && mouseY <= 500) {
stroke(r, g, b);
}}}
if (mousePressed && mouseButton == RIGHT){
fill (r,g,b);
stroke (r,g,b);
triangle (mouseX+5, mouseY+5, mouseX+10, mouseY+20, mouseX+10, mouseY-10);
triangle (mouseX+5, mouseY+5, mouseX, mouseY+20, mouseX, mouseY-10);
//draws brush
}

strokeWeight (weight);
if (mousePressed){
fill (r,g,b);
rect (mouseX, mouseY, 5, 5);//draws square
}}

void keyPressed(){
if (key == CODED){
if (keyCode == UP)
weight += 1;
else if (keyCode == DOWN)
weight -= 1;
}

if (key == ‘q’){
r += 10;
}if (key == ‘a’){
r -= 10;
}if (key == ‘w’){
g += 10;
}if (key == ‘s’){
g -= 10;
}if (key == ‘e’){
b += 10;
}if (key == ‘d’){
b -= 10;
}if (key == ‘z’){
r = 0;
}if (key == ‘x’){
g = 0;
}if (key == ‘c’){
b = 0;
}if (key == ‘v’){
r = 255;
g = 255;
b = 255;
}
}

Advertisements
This entry was posted in Non-Timebased 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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s