Digital Landscape Re-do

Screen Shot 2016-09-28 at 10.36.10 PM.png

Code:

//COLOR\\
float x, y;
int white = 0;
int red = 0;
int blue = 0;
int green = 0;
int yellow = 0;
int purple = 0;
int tred = 0;
int tblue = 0;
int tgreen = 0;
int tyellow = 0;
int tpurple = 0;
int orange = 0;
int black = 0;
int blur = 0;
int set1 = 0;
int set2 = 0;
color c = color(255, 0, 0);
//SHAPES\\
int quad1 = 0;
int quad2 = 0;
int line = 0;
int ellipse = 0;
int BGS = 0;
void setup() {
size(1080, 720);
background(0);
fill(0, 0, 50);
rect(0, 0, 1080, 300);
}
void draw() {
noStroke();

//KEYES\\
//COLORS\\
if (keyPressed) {
if (key == ‘o’)
set1 = 1;
set2 = 0;
}
if (key == ‘p’)
set1 = 0;
set2 = 1;
if (set1 == 1) {
if (key == ‘1’) {
red = 1;
green = 0;
blue = 0;
yellow = 0;
purple = 0;
orange = 0;
white = 0;
black = 0;
blur = 0;
}
if (key == ‘2’) {
red = 0;
green = 1;
blue = 0;
yellow = 0;
purple = 0;
orange = 0;
white = 0;
black = 0;
blur = 0;
}
if (key == ‘3’) {
red = 0;
green = 0;
blue = 1;
yellow = 0;
purple = 0;
orange = 0;
white = 0;
black = 0;
blur = 0;
}
if (key == ‘4’) {
red = 0;
green = 0;
blue = 0;
yellow = 1;
purple = 0;
orange = 0;
white = 0;
black = 0;
blur = 0;
}
if (key == ‘5’) {
red = 0;
green = 0;
blue = 0;
yellow = 0;
purple = 1;
orange = 0;
white = 0;
black = 0;
blur = 0;
}
if (key == ‘6’) {
red = 0;
green = 0;
blue = 0;
yellow = 0;
purple = 0;
orange = 1;
white = 0;
black = 0;
blur = 0;
}
if (key == ‘0’) {
red = 0;
green = 0;
blue = 0;
yellow = 0;
purple = 0;
orange = 0;
white = 1;
black = 0;
blur = 0;
}
if (key == ‘e’) {
red = 0;
green = 0;
blue = 0;
yellow = 0;
purple = 0;
orange = 0;
white = 0;
black = 1;
blur = 0;
}
if (key == ‘b’) {
red = 0;
green = 0;
blue = 0;
yellow = 0;
purple = 0;
orange = 0;
white = 0;
black = 0;
blur = 1;
}
}
if (set2 == 1){
if (key == ‘1’) {
tred = 1;
tgreen = 0;
tblue = 0;
tyellow = 0;
tpurple = 0;
blur = 0;
}
if (key == ‘2’) {
tred = 0;
tgreen = 1;
tblue = 0;
tyellow = 0;
tpurple = 0;
blur = 0;
}
if (key == ‘3’) {
tred = 0;
tgreen = 0;
tblue = 1;
tyellow = 0;
tpurple = 0;
blur = 0;
}
if (key == ‘4’) {
tred = 0;
tgreen = 0;
tblue = 0;
tyellow = 1;
tpurple = 0;
blur = 0;
}
if (key == ‘5’) {
tred = 0;
tgreen = 0;
tblue = 0;
tyellow = 0;
tpurple = 1;
blur = 0;
}
}
if (key == ‘z’) {
quad1 = 1;
quad2 = 0;
line = 0;
ellipse = 0;
BGS = 0;
}
if (key == ‘x’) {
quad1 = 0;
quad2 = 1;
line = 0;
ellipse = 0;
BGS = 0;
}
if (key == ‘c’) {
quad1 = 0;
quad2 = 0;
line = 1;
ellipse = 0;
BGS = 0;
}
if (key == ‘v’) {
quad1 = 0;
quad2 = 0;
line = 0;
ellipse = 1;
BGS = 0;
}
if (key == ‘a’) {
quad1 = 0;
quad2 = 0;
line = 0;
ellipse = 0;
BGS = 1;
}
if (mousePressed == true) {
if (tred == 1) {
fill (50, 0, 0);
if (BGS == 1) {
stroke(50, 0, 0);
strokeWeight(100);
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
if (tgreen == 1) {
fill (0, 50, 0);
if (BGS == 1) {
stroke(0, 50, 0);
strokeWeight(100);
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
if (tblue == 1) {
fill (0, 0, 50);
if (BGS == 1) {
stroke(0, 0, 50);
strokeWeight(100);
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
if (tyellow == 1) {
fill (50, 50, 0);
if (BGS == 1) {
stroke(50, 50, 0);
strokeWeight(100);
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
if (tpurple == 1) {
fill (50, 10, 50);
if (BGS == 1) {
stroke(50, 10, 50);
strokeWeight(100);
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
}
}
void mousePressed() {
x = mouseX;
y = mouseY;
}
void mouseReleased() {

if (red == 1) {
fill(255, 0, 0);
if (quad1 == 1) {
quad(x-10, y, x+10, y, mouseX, mouseY, mouseX, mouseY);
fill(255, 0, 0, 100);
quad(x-20, y, x+20, y, mouseX, mouseY, mouseX, mouseY);
}
if (quad2 == 1) {
quad(x, y-10, x, y+10, mouseX, mouseY, mouseX, mouseY);
fill(255, 0, 0, 100);
quad(x, y-20, x, y+20, mouseX, mouseY, mouseX, mouseY);
}
if (line == 1) {
stroke(255, 0, 0);
strokeWeight(1);
line(x, y, mouseX, mouseY);
}
if (ellipse == 1) {
ellipse(mouseX, mouseY, 50, 50);
fill(255, 0, 0, 100);
ellipse(mouseX, mouseY, 80, 80);
}
}
if (green == 1) {
fill(0, 255, 0);
if (quad1 == 1) {
quad(x-10, y, x+10, y, mouseX, mouseY, mouseX, mouseY);
fill(0, 255, 0, 100);
quad(x-20, y, x+20, y, mouseX, mouseY, mouseX, mouseY);
}
if (quad2 == 1) {
quad(x, y-10, x, y+10, mouseX, mouseY, mouseX, mouseY);
fill(0, 255, 0, 100);
quad(x, y-20, x, y+20, mouseX, mouseY, mouseX, mouseY);
}
if (line == 1) {
stroke(0, 255, 0);
strokeWeight(1);
line(x, y, mouseX, mouseY);
}
if (ellipse == 1) {
ellipse(mouseX, mouseY, 50, 50);
fill(0, 255, 0, 100);
ellipse(mouseX, mouseY, 80, 80);
}
}

if (blue == 1) {
fill(0, 0, 255);
if (quad1 == 1) {
quad(x-10, y, x+10, y, mouseX, mouseY, mouseX, mouseY);
fill(0, 0, 255, 100);
quad(x-20, y, x+20, y, mouseX, mouseY, mouseX, mouseY);
}
if (quad2 == 1) {
quad(x, y-10, x, y+10, mouseX, mouseY, mouseX, mouseY);
fill(0, 0, 255, 100);
quad(x, y-20, x, y+20, mouseX, mouseY, mouseX, mouseY);
}
if (line == 1) {
stroke(0, 0, 255);
strokeWeight(1);
line(x, y, mouseX, mouseY);
}
if (ellipse == 1) {
ellipse(mouseX, mouseY, 50, 50);
fill(0, 0, 255, 100);
ellipse(mouseX, mouseY, 80, 80);
}
}

if (yellow == 1) {
fill(252, 255, 0);
if (quad1 == 1) {
quad(x-10, y, x+10, y, mouseX, mouseY, mouseX, mouseY);
fill(252, 255, 0, 100);
quad(x-20, y, x+20, y, mouseX, mouseY, mouseX, mouseY);
}
if (quad2 == 1) {
quad(x, y-10, x, y+10, mouseX, mouseY, mouseX, mouseY);
fill(252, 255, 0, 100);
quad(x, y-20, x, y+20, mouseX, mouseY, mouseX, mouseY);
}
if (line == 1) {
stroke(252, 255, 0);
strokeWeight(1);
line(x, y, mouseX, mouseY);
}
if (ellipse == 1) {
ellipse(mouseX, mouseY, 50, 50);
fill(252, 255, 0, 100);
ellipse(mouseX, mouseY, 80, 80);
}
}

if (purple == 1) {
fill(167, 2, 253);
if (quad1 == 1) {
quad(x-10, y, x+10, y, mouseX, mouseY, mouseX, mouseY);
fill(167, 2, 253, 100);
quad(x-20, y, x+20, y, mouseX, mouseY, mouseX, mouseY);
}
if (quad2 == 1) {
quad(x, y-10, x, y+10, mouseX, mouseY, mouseX, mouseY);
fill(167, 2, 253, 100);
quad(x, y-20, x, y+20, mouseX, mouseY, mouseX, mouseY);
}
if (line == 1) {
stroke(167, 2, 253);
strokeWeight(1);
line(x, y, mouseX, mouseY);
}
if (ellipse == 1) {
ellipse(mouseX, mouseY, 50, 50);
fill(167, 2, 253, 100);
ellipse(mouseX, mouseY, 80, 80);
}
}

if (orange == 1) {
fill(255, 199, 5);
if (quad1 == 1) {
quad(x-10, y, x+10, y, mouseX, mouseY, mouseX, mouseY);
fill(255, 199, 5, 100);
quad(x-20, y, x+20, y, mouseX, mouseY, mouseX, mouseY);
}
if (quad2 == 1) {
quad(x, y-10, x, y+10, mouseX, mouseY, mouseX, mouseY);
fill(255, 199, 5, 100);
quad(x, y-20, x, y+20, mouseX, mouseY, mouseX, mouseY);
}
if (line == 1) {
stroke(255, 199, 5);
strokeWeight(1);
line(x, y, mouseX, mouseY);
}
if (ellipse == 1) {
ellipse(mouseX, mouseY, 50, 50);
fill(255, 199, 5, 100);
ellipse(mouseX, mouseY, 80, 80);
}
}

if (white == 1) {
fill(255);
if (quad1 == 1) {
quad(x-10, y, x+10, y, mouseX, mouseY, mouseX, mouseY);
fill(255, 255, 255, 100);
quad(x-20, y, x+20, y, mouseX, mouseY, mouseX, mouseY);
}
if (quad2 == 1) {
quad(x, y-10, x, y+10, mouseX, mouseY, mouseX, mouseY);
fill(255, 255, 255, 100);
quad(x, y-20, x, y+20, mouseX, mouseY, mouseX, mouseY);
}
if (line == 1) {
stroke(255);
strokeWeight(1);
line(x, y, mouseX, mouseY);
}
if (ellipse == 1) {
ellipse(mouseX, mouseY, 50, 50);
fill(255, 255, 255, 100);
ellipse(mouseX, mouseY, 80, 80);
}
}
if (blur == 1) {
fill(100);
filter(BLUR, 1);
}
}

Advertisements
This entry was posted in Interactive Authoring 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