Above are the images of the drawing program I created using processing and the imaginary landscape I created with that program. In the drawing program, you can choose to draw with a triangle, circle or square. You can also change the size and color of the shape.
In this landscape, the brown circles are different pieces of land, the purple squares are used to travel from one piece of land to the other and the blue triangles are the sky that travels above the land. The green circles in the sky are two of the many different types of terrains that take turns on each piece of land. They are in the sky right now because they are in the middle of switching lands.
Below are the codes that I used to create this drawing program:
int shape = 100;
boolean rectangle = false;
boolean ellipse = false;
boolean triangle = false;
int joe = 8;
int karry = 8;
int brush = 50;
PFont font;
void setup (){
size (600,570);
background (255);
font = createFont (“Times”, 30);
colorMode (HSB,100,100,100);
}
void draw (){
fill(68);
rect (0,450,600,600);
line(1, 450, 600,450);
//shapes
fill(0);
rect (527,469,50,50);
ellipse (491,494,50,50);
triangle (464,518,375,518,420,471);
fill(0);
text(“Shapes”, 317, 517);
//blackbars
rect (8,496,150,10);
rect (8,468,150,10);
//sliders
fill(joe-10,100,70);
rect (joe,489,10,25);
fill (100);
rect (karry,459,10,25);
if (mouseX<577 && mouseX>527 && mouseY<519 && mouseY>469){
rectangle = true;
ellipse = false;
triangle = false;
}
if (rectangle && mousePressed && mouseY<430){
fill (joe-10,100,70);
rect (mouseX-25,mouseY-25,brush,brush);
}
if(mouseX<541 && mouseX>491 && mouseY<544 && mouseY>494){
ellipse = true;
rectangle = false;
triangle = false;
}
if (ellipse && mousePressed && mouseY<430){
fill (joe-10,100,70);
ellipse (mouseX, mouseY,brush,brush);
}
if (mouseX<464 && mouseX>375 && mouseY<518 && mouseY>471){
triangle = true;
ellipse = false;
rectangle = false;
}
if (triangle && mousePressed && mouseY<430){
fill (joe-10,100,70);
triangle (mouseX-(brush/2),mouseY+(brush/2),mouseX+(brush/2),mouseY+(brush/2),mouseX,mouseY-(brush/2));
}
//blackbars and sliders
fill(0);
text (“Size”, 168, 478);
if (mousePressed && mouseX >7 && mouseX< 158 && mouseY >496 && mouseY<506){
joe = mouseX;
}
fill(0);
text (“Color”, 167, 505);
if (mousePressed && mouseX >7 && mouseX< 158 && mouseY >468 && mouseY<478){
karry = mouseX;
brush = karry;
}
if (keyPressed){
if (key == ‘a’ || key == ‘A’){
triangle = true;
ellipse = false;
rectangle = false;
}
if (key == ‘s’ || key == ‘S’){
triangle = false;
ellipse = true;
rectangle = false;
}
if (key == ‘d’ || key == ‘D’){
triangle = false;
ellipse = false;
rectangle = true;
}
if (key == ‘z’ || key == ‘Z’){
if (karry< 158){
karry = karry + 1;
brush = brush + 1;}
}
if (key == ‘x’ || key == ‘X’){
if (karry> 7){
karry = karry – 1;
brush = brush -1;}
}
if (key == ‘q’ || key == ‘Q’){
if (joe< 158){
joe = joe + 1;}
}
if (key == ‘w’ || key == ‘W’){
if (joe> 7){
joe = joe – 1;}
}
}
}
void mouseDragged (){
}