Digital Landscape

Screen Shot 2016-09-26 at 6.23.46 PM.png

Code used (324 lines):

//COLOR\\
float x, y;
int white = 0;
int red = 0;
int blue = 0;
int green = 0;
int yellow = 0;
int purple = 0;
int orange = 0;
int black = 0;
int blur = 0;
color c = color(255, 0, 0);
//SHAPES\\
int quad1 = 0;
int quad2 = 0;
int line = 0;
int ellipse = 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 == ‘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 (key == ‘z’) {
quad1 = 1;
quad2 = 0;
line = 0;
ellipse = 0;
}
if (key == ‘x’) {
quad1 = 0;
quad2 = 1;
line = 0;
ellipse = 0;
}
if (key == ‘c’) {
quad1 = 0;
quad2 = 0;
line = 1;
ellipse = 0;
}
if (key == ‘v’) {
quad1 = 0;
quad2 = 0;
line = 0;
ellipse = 1;
}
}
}
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);
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);
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);
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);
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);
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);
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);
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