Final Project-InfoGlobe

Final Project: InfoGlobe

Partner: Mostafa

Inspiration: Our inspiration of InfoGlobe is that we want to create something that can be both educational and useful for users to learn about the geography of a certain place.

Conceptual development: Firstly, we thought of making it as a tool that people can choose from a selection of destinations. Then when the users click on the certain destination, the globe will automatically rotate to that destination and information about the place would show up on the screen. Information like where is the most popular tourist destination and the best hotels would show up on the screen. However, during our presentation of showing our ideas, a student gave us an advice of setting up different price ranges. Also, when we went to a fellow. She said it is better if we have a clear audience for this tool to use and it would also be better if we make it more interactive.

Thus we decided to change the format of it and changed it into a game where people can press the keys on the keyboard in order to rotate the globe and then when the globe turn to the correct destination, information about the place would show up.

Technical development: We were going to place a mini airplane(using 3d printing) on the globe to make it more visual pleasuring but then the rubber band would not sustain the airplane, so we just placed an origami airplane instead. I looked through various websites about the tourists’ information for the destination and gathered all of them in photoshop, then load the images to processing and Mostafa connected the physical globe with Arduino and also added a sound effect when people rotate to the right destination, a bell would ring.

Here are the different images I created on photoshop:

 

Here is the homepage where people can choose which country a=to rotate and the instruction of using the device:

User testing:

We found out that

  1. users were not clear about the instructions that they do not need to do anything when they choose a destination but to just use keys “J” and “K” to rotate the globe.
  2. Some users were not clear about the interaction and think there could be more interaction involved when they rotate to the correct destination.

Lesson learned:

I learned that planning every step is important instead of just thinking in a big picture. HOwever, adjustments are also needed to be made when things do not go as the way we expect, such as creating a tool instead of a game.

Also, when creating something interactive, it is important to let the readers know clearly the instructions of the device, or else the device would not work as you wish.

Final thoughts:

I would definitely add different price range options and add different tags for people who like to travel individually or with their friends. I think this would definitely add more interaction and fun to the device.

This is a video for user testing(Sorry for the bad angle):

 

 

Ix Lab Antonius: Smash the Patriarchy final

SMASH THE PATRIARCHY PROJECT

The project is a trivia about gender inequality and feminism, created in Processing, controlled by punching an inflatable doll, which symbolizes patriarchy.

Patriarchy waiting to be smashed during the IMA show

INSPIRATION 

The idea for the “Smash the Patriarchy” project came from my midterm project and my own belief in feminism. My midterm project (a music trivia) met very positive reactions, people liked the the visuals, liked the questions and laughed a lot. Keeping that in mind, I decided to keep “Smash the Patriarchy” in a similar formula. The other part of my inspiration is just a general observation that while recently a lot has been happening in the feminist movements, e.g. #MeToo, Women’s March, Time’s Up, there’s still a significant lack of knowledge about gender inequality, and to a certain extent denial that gender inequality is real. Putting these two together I wanted to create a project that would take people a step closer to the realization that gender inequality is a problem and that there is a lot that needs to be done, but at the same time be entertaining. The final project was a trivia about gender inequality controlled by punching a boxing doll of an angry men representing patriarchy.

DEVELOPMENT

Before bringing the project to the idea-sharing session in class two weeks before the final, I wasn’t planning on including the inflatable doll, but rather use a toy with two plastic figures boxing each other to represent the fight with patriarchy. However, my classmates suggested that having a bobo doll, which users could punch, would be more engaging and would become a more powerful way of expressing the idea of smashing patriarchy. Because answers to questions are displayed on the left and on the right side of the screen, I needed to find an intuitive and fun way to pick the answers. Taking those two elements into account, I used the inflatable doll as the trivia controller.

Initially, I was planning to use an accelerometer so that moving the doll to the left side would pick the left answers, and moving it to the right would pick the right answer. But because accelerometer has many values and it would be difficult to control it (because the doll goes back to the center after every punch), I had to drop that idea. Following Antonius’ suggestion, I used two tilt switches and connected them to arduino. The breadboard was stuck to the bottom of the doll’s back and the wires were glued to the breadboard to make sure they wouldn’t fall out.

In order to give users immediate feedback I placed a yellow dot at the bottom of each screen, which tracked the movement of the tilt switches (the doll), when the doll was tilting to the left side, the dot moved to the left, when the doll was tilting to the right side, the dot moved to the right side, too. While answering questions by punching the doll users saw green text appearing on the screen: “Yes! Keep punching!” if the answer was correct and “Sadly, no”. At the same time, color of the dot changed from yellow to green to indicate the movement.

THE TRIVIA:

These are the starting screen, questions and statement at the end.

TESTING: Video of the first user testing 

After a couple of rounds of user testing I changed the following elements:

  • Decreased the time it takes to move to another screen after punching the doll. The goal was to make people feel frustrated that it takes a long time to fight patriarchy, but some of them simply wanted to give up and not answer all questions.
  • Taking out the dot tracking doll movement from the last screen. It only confused people and they thought there were more questions.
  • Leaving open access to the breadboard attached to the doll. Initially the breadboard was secured and covered by tape. But some users were punching so hard that the breadboard moved or disconnected from the arduino. Following Antonius’ suggestion I rearranged it, added more tape to the wires and uncovered the breadboard to have easy access in case something disconnects.

IMPROVEMENTS

Here’s a list of improvements that should be done to make the project work better:

  • Chinese language version. during the show some people didn’t completely understand the idea of the project and couldn’t answer some questions because they didn’t completely understand what was written on the screen.
  • A better method of giving feedback. Some people were so involved in punching the doll that they didn’t pay attention to the screen and didn’t realize that they were choosing the wrong answer. While it does a good job of highlighting that the project is a metaphor of fighting the real-life patriarchy, it does it only when people actually see the feedback on the screen. Without looking at feedback the project turns more into a punching game. Moreover, because sometimes two questions in a row had correct answers placed on the same side, people focused on punching so much that they didn’t look at the screen and skipped some questions.
  • Better instructions. Similarly to the midterm, the instructions weren’t completely clear and people had troubles with understanding which side to punch to get the answer they’re choosing. The instructions said “to pick left-side answer, punch the doll to the left”. Some people got it right away, some tried punching doll’s left side and not getting the answer they wanted to. At some point of the show I just walked people through them and demonstrated quickly by tilting the doll. However, I am still not sure what’s the best way of explaining it, because the brief user testing showed that giving instructions that would mix to directions in one sentence (e.g. “to to pick left-side answer, punch doll’s right side”) was completely confusing.
  • A more intuitive way of starting the game. People were confused why they needed to start punching to see the first question. The idea behind it was to “train” them how to answer questions, but I don’t think it actually worked that way and only caused confusion. I think the easiest way to solve it would be to attach a large button (large enough to match the size of boxing gloves) to start the trivia.

FINAL THOUGHTS  

Overall I am really satisfied with the outcomes of this project. On the technical side it worked as it was supposed to and there weren’t any serious issues, except for the problem of people punching too hard and moving the breadboard with sensors too much. Using the doll was a very good choice, it was attention grabbing and a lot of people seeing it from far away during the show came to check it out, and definitely worked well to emphasise the feminist message of my project. It seemed that the idea of smashing the patriarchy resonated with many people, many women were happy to be able to punch the patriarchy’s face, while many men were genuinely surprised by correct answers to some of the questions. The project both evoked emotions and taught them a little bit about gender inequality, and ultimately became a feminist statement which is exactly what I intended to do.

ARDUINO CODE

import processing.serial.*;

Serial myPort;
int[] sensorValues;

int l;
int r;

void setup(){
 size(100,100);
 myPort = new Serial(this, "/dev/cu.usbmodem1421", 9600);
 sensorValues = new int[2];
}

void draw(){
 // Arduino - processing communnication 
 while(myPort.available()>0){
 String fromArduino = myPort.readStringUntil(10);
 if(fromArduino != null){
 String[] serialInArray = split(trim(fromArduino), ",");
 if (serialInArray.length == sensorValues.length){
 for(int i=0; i<serialInArray.length; i++){
 sensorValues[i] = int(serialInArray[i]);
 print(sensorValues[i]);
 print(" ");
 }
 println();
 }
 }
 }
 // naming values from the switch 
 l = sensorValues[0];
 r=sensorValues[1];
 if (l == 1){
 background(#3C0FD6);
 } else if (r==1){
 background(#F024B3);
 } else{
 background(0, 255, 0);
 }
}
import processing.sound.*;
import processing.serial.*;
import gifAnimation.*;

Serial myPort;
int[] sensorValues;
int l;
int r;
int next = 0;

int counter = 0;
int currentScore = 0;
int moveX, moveY;

PFont f;

PImage girlPower;
PImage beyonce;
PImage moneySmall;

Gif bullshit;
Gif cans;
Gif lastGif;
Gif ruth;


void setup(){
  size(1300, 800);
  myPort = new Serial(this, "/dev/cu.usbmodem65", 9600);
  sensorValues = new int[2];
  moveX = width/2;
  moveY = height-100;
  lastGif = new Gif(this, "lastGif.gif");
  bullshit = new Gif(this, "bullshit.gif");
  cans = new Gif(this, "cans.gif");
  ruth = new Gif(this, "ruth2.gif");
}

void draw(){
  //Arduino - processing communnication 
  println(counter);
  while(myPort.available()>0){
    String fromArduino = myPort.readStringUntil(10);
    if(fromArduino != null){
      String[] serialInArray = split(trim(fromArduino), ",");
      if (serialInArray.length == sensorValues.length){
        for(int i=0; i<serialInArray.length; i++){
          sensorValues[i] = int(serialInArray[i]);
          print(sensorValues[i]);
          print(" ");
        }
        println();
      }
    }
  }
  // naming values from the switch 
  l = sensorValues[0];
  r=sensorValues[1];
  
  if (counter == 0) { // Welcome Screen
    state0();
  } else if (counter == 1){ //Instructions 
    state1();
  } else if (counter == 2){ //Question 1
    state2();
  } else if (counter == 3){ //Question 2
    state3();
  } else if (counter ==4){ //Question 3
    state4();
  } else if (counter ==5){ //Question 4
    state5();
  } else if (counter ==6){ //End screen
    state6();
  } else{ // reset! go back to the welcome screen 
    setup();
  }
  
  ellipse(moveX,moveY,35,35);
  fill(255);
  noStroke();
  // test!/
  counterCheckWithArduino();
}

void mouseClicked(){
  if (counter == 0){
    counter ++;
    }
  else if (counter == 1){ 
      counter++;
    }
  else if (counter == 2){ //Question 1
      currentScore += 10;
      counter++;
    }
  else if (counter == 3){ //Question 2
      currentScore +=10;
      counter++;
    }
  else if (counter ==4){ //Question 3
      currentScore +=10;
      counter++;
    }
  else if (counter == 5){ //Question 4
      currentScore +=10;
      counter++;
    }
  else { //The End
    counter=0;
    currentScore = 0;
  }
}

void counterCheckWithArduino(){
  if ((counter == 0 && next==1) || (counter == 0 && moveX>(width/2)+100)){ //Welcome Screen 
    counter = 1;
    // reset moveX
    moveX = width/2;
    next=0;
    }
  else if (counter == 1 && moveX>(width/2)+100){ //Question 1
      counter=2;
      moveX=width/2;
    }
  else if (counter == 2 && moveX>(width/2)+100){ //Question 2
      counter++;
      moveX=width/2;
    }
  else if (counter == 3 && next ==1){ //Question 3
      counter++;
      moveX=width/2;
      next = 0;
    }
  else if (counter ==4 && next ==1 ){ //Question 4
      counter++;
      moveX=width/2;
      next = 0;
    }
  else if ((counter == 5 && moveX>(width/2)+100) || (counter == 5 && next ==1)) { //Question 5
      counter++;
      moveX=width/2;
    } 
  else if (counter ==6) { // The End
      currentScore = 0;
    }
}

void state0(){ //Welcome Screen
  background(#F024B3);
  f = createFont("Futura-MediumItalic",40,true);
  fill(#3C0FD6);
  textFont(f,60);
  text("SMASH THE PATRIARCHY!", 360,100);
  textFont(f, 35);
  text("How to play?", 600, 200);
  text("1. To pick left-side answer,", 600, 300);
  text("punch the doll to the left", 630, 350);
  text("2. To pick right-side answer,", 600, 450);
  text("punch the doll to the right", 630, 500);
  text("3.Put the gloves on and", 600, 600);
  text("start punching one side of the doll!", 630, 650);
  fill(#DAFC00); //ellipse's color
  girlPower = loadImage("girlpower.png");
  image(girlPower, -45, 92);
  if (l==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes! Keep punching", 400, 750);
    if(moveX<(width/2)-100){
      next=1;
    }
    moveX--;
  }else if (r==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes! Keep punching", 400,750);
    moveX++;
  }
}

void state1(){ //Question 1 
  background(#F024B3);
  f = createFont("Futura-MediumItalic",35,true);
  fill(#3C0FD6);
  textFont(f, 40);
  text("Looking for jobs? Great! Better start saving now.", 30, 70);
  text("Women are paid ...% of men's wage:", 30, 140);
  moneySmall = loadImage("moneySmall.png");
  image(moneySmall, 0, 650);
  image(moneySmall, 150, 650);
  image(moneySmall, 300, 650);
  image(moneySmall, 0, 450);
  image(moneySmall, 150, 450);
  image(moneySmall, 450, 650);
  image(moneySmall, 900, 650);
  image(moneySmall, 1050, 650);
  image(moneySmall, 1200, 650);
  image(moneySmall, 0, 550);
  image(moneySmall, 150, 550);
  image(moneySmall, 300, 550);
  image(moneySmall, 1050, 550);
  image(moneySmall, 1200, 550);
  image(moneySmall, 1200, 450);
  image(moneySmall, 1200, 350);
  image(moneySmall, 150, 350);
  image(moneySmall, 0, 350);
  image(moneySmall, 0, 250);
  image(moneySmall, 750, 650);
  image(moneySmall, 900, 550);
  image(moneySmall, 1050, 450);
  textFont(f, 80);
  text("100%", 350, 400);
  text("77%", 750, 400);
  fill(#DAFC00);
  if (l==1){
    textFont(f,50);
    fill(#29D33D);
    text("Sadly, no", 120, 250);
    moveX--;
  }else if (r==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes! Keep punching", 800,250);
    moveX++;
  }
}

void state2(){ //Question 2 
  background(#F024B3);
  f = createFont("Futura-MediumItalic",40,true);
  fill(#3C0FD6);
  textFont(f, 35);
  text("Are you 27 and unmarried? You must be really picky!", 20, 70);
  text("You better hurry up and have kids, before you become a leftover woman!", 20, 140);
  textFont(f, 50);
  text("You're right!", 50, 400);
  text("I should get", 50, 450);
  text("married soon!", 50, 500);
  text("I will marry", 950, 400);
  text("if and when", 950, 450); 
  text("I want to!", 950, 500);
  image(bullshit, 410,280);
  bullshit.play();
  fill(#DAFC00); //for the ellipse
  if (l==1){
    textFont(f,50);
    fill(#29D33D);
    text("No way!", 120, 250);
    moveX--;
  }else if (r==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes! Keep punching", 800,250);
    moveX++;
  }
}

void state3(){ //Question 3 
  background(#F024B3);
  f = createFont("Futura-MediumItalic",35,true);
  textFont(f, 40);
  fill(#3C0FD6);
  text("Are you an aspiring artist? Better find a gallery to represent you!", 20, 70);
  text("Guess, how many of represented artists are women?", 20, 140);
  textFont(f, 80);
  text("14%", 100, 400);
  text("49%", 1000, 400);
  fill(#DAFC00); //for the ellipse
  image(cans, 410,250);
  cans.play();
  if (l==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes, keep punching", 80, 220);
    if(moveX<(width/2)-100){
      next=1;
    }
    moveX--;
  }else if (r==1){
    textFont(f,50);
    fill(#29D33D);
    text("Sadly, no", 800,220);
    moveX++;
  }
}

void state4(){ //Question 4 
  background(#F024B3);
  f = createFont("Futura-MediumItalic",35,true);
  textFont(f, 40);
  fill(#3C0FD6);
  text("If March is Women's History Month,", 20, 70);
  text("what happens the rest of the year?", 20, 120);
  textFont(f, 60);
  text("Patriarchy!", 40, 400);
  text("We're equal!", 900, 400);
  fill(#DAFC00); //for the ellipse
  image(ruth, 460,250);
  ruth.play();
  if (l==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes, keep punching", 80, 220);
    if(moveX<(width/2)-300){
      next=1;
    }
    moveX--;
  }else if (r==1){
    textFont(f,50);
    fill(#29D33D);
    text("Sadly, no", 800,220);
    moveX++;
  }
}

void state5(){//Question 5
  background(#F024B3);
  f = createFont("Futura-MediumItalic",40,true);
  fill(#3C0FD6);
  textFont(f, 55);
  text("Who run the world?", 30, 70);
  textFont(f,80);
  text("GIRLS", 100, 400);
  text("GIRLS", 1000, 400);
  beyonce = loadImage("beyonce.png");
  image(beyonce, 420, 180);
  fill(#DAFC00); //for the ellipse
  if (l==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes! Keep punching!", 80, 140);
    if(moveX<(width/2)-100){
      next=1;
    }
    moveX--;
  }else if (r==1){
    textFont(f,50);
    fill(#29D33D);
    text("Yes! Keep Punching!", 800, 140);
    moveX++;
  }
}

void state6(){ //End Screen 
  background(#F024B3);
  f = createFont("Futura-MediumItalic",40,true);
  fill(#3C0FD6);
  textFont(f, 35);
  text("Tired? Frustrated? Want to keep punching? This is how fighting patriarchy feels.", 10, 80);
  text("Being a woman is sometimes difficult. You're facing assumptions and sterotypes.", 10, 130);
  text("You're paid less than your male counterparts. Why is it a standard in 2018?", 10, 180);
  text("It takes time and effort. But every punch in the patriarchy's face counts.", 80, 630);
  fill(#DAFC00);
  text("FIGHT THE PATRIARCHY BACK! PUNCH IT! SMASH IT!", 200, 680);
  image(lastGif, 400, 215);
  lastGif.play();
  fill(#F024B3); //for the ellipse
}

Ix Lab Emily Qiu Final Project: “A Mini Chemistry Lab” (Antonius)

Name of the Project: A Mini Chemistry Lab

Instructor: Professor Antonius

Partner: Grace

DESCRIPTION OF THE PROJECT

This project is both an educational and entertainment tool for kids who are interested in chemistry  experiments or actually whoever that is interested in chemistry experiments but fail to get access to the real lab can try this project. The project has two modes--experiment mode and magical mode in correspondence with the educational purpose and the entertainment use. For the experiment mode, basically, it is like a virtual experiment project but different from that, users can conduct partial physical interactions with the touchable laboratory equipments (currently what we have is a beaker) and view the process of the experiment step by step on the screen. In other words, users will be able to experience some interesting experiments in a both vivid and safe manner. As for the magical mode, it is more like a game as a treat to who has finished the experiment mode. Users will be able to experience a series of very weird but surprising “experiments” and you can check it out later in the demo. We have tried our best to make the project user-friendly because according to the user feedbacks for both our midterm projects, we think it is a very important point so we have designed many details to make the project become more “comfortable” for the user, such as changing cursor to indicate different functions or to add some little hints to let the user understand the rules more easily, which will be further explained in the following sections.

Grace is mainly responsible for the Arduino part and the physical part while I am mainly responsible for the processing part ❤️.

 

CONCEPTUAL DEVELOPMENT — IDEATION & RESEARCH

 

  • #Inspiration# My inspiration mainly comes from my own experience when I was little, actually not very little, like a Grade 4 or Grade 5. I was deeply attracted by chemicals and chemistry experiments during those days after our science teacher showed us how to make oxygen via heating KMnO4. In addition, my grandma used to be a high school chemistry teacher so she really encouraged me to explore the amazing world of chemistry. However, when I asked them whether could I operate some experiments by myself, both of them said no because they thought it was too dangerous to let a kid to touch those chemicals. I was super depressed and my curiosity even grew bigger when they rejected my request. So my grandma finally agreed to let me conduct some experiments that are very safe and can be conducted with household materials such as sugar or vinegar. Still, she would never let me to do some “potentially harmful” things such as using fire, the most frequent thing she asked me to do was to measure a certain volume of liquid. I was confused at the beginning about why it was important to read the accurate volume because if I was allowed to do one on my own, I would just mix those liquids together regardless of their proportion as it was easy and convenient. Then one day, my grandma told me that you might see reading volume as  a boring task but in fact, it is really a crucial ability that I should be equipped with because different proportions of chemicals can result in completely different reactions and some of them can be rather dangerous such as explosion. Thus, the ability to read accurate volume and get to understand the importance of the concept “proportion” to chemical experiments is something we want to emphasize, so this is also the focus of our project. We want our children to feel the charm of chemical experiments in both a safe and entertaining manner and we hope that they can learn something like what I did when I was a kid.

 

  • #References#  
  1. YouTube Virtual Chemistry Lab Video: Our project is somewhat similar to a VR lab because users cannot really see the actual, physical reactions but instead, they view the experiments in a relatively virtual way. So we get some inspiration from this video about how to build interactions between physical movements and the changes appearing in the screen. https://www.youtube.com/watch?v=M7kaLX4_qL0
  2. Processing organization: when I was thinking about the interaction design for Processing part, I refer to this website for help:https://processing.org
  3. Pinterest: my images and some visual elements are credited to this website: https://www.pinterest.com
  4. Some coding example reference:https://forum.processing.org/two/discussion/21785/bubbles-blinking(bubbles) https://www.dfrobot.com/wiki/index.php/SHARP_GP2Y0A41SK0F_IR_ranger_sensor_(4-30cm)_SKU:SEN0143 (Sensor)

 

  • #Target Audience# As what I have mentioned before, my target audience are mainly kids who are interested in chemistry experiments but are too young to operate those real ones on their own. Actually it is more like a puzzle game especially its magical mode, so I would say that the range of audience is actually even broader.

 

TECHNICAL DEVELOPMENT–DESIGN & IMPLEMENTATION

 

  • #Flow Chart# 

Before implementation, we have drawn many drafts and have discussed about many possible plans, this is our final version of flow chart showing basically how our project works.

 

  • #Materials# 
  1. Distance Sensor
  2. Breadboard
  3. All kinds of wires in the Knit
  4. Arduino
  5. Tape and two measuring pots

 

  • #Arduino and Physical Part# 

The coding for the Arduino part is not very complex which is basically used to read the sensor and transmit the data to the processing.

The most difficult part might be how to build proper connections between the data provided by distance sensor and the volume of the liquid. The sensor we use is a distance sensor, though at the very beginning we planned to use water pressure sensor or weight sensor,

it turned out that either ER doesn’t have one or it is just too complex so that our target users might not be able to do that. So in the end, we decide to use distance to test the volume of the liquid since our measuring cup is a standard cup. So here is a sketch showing how our sensor works. As is shown in the code, there is a conversion which though seems to be simple, in fact costs a lot of time and trials to figure out how to make those two data consistent.

 

  • #Processing# 

To begin with, we have approximately 600 lines of codes for processing because we have six pages in total with animation and many images. I feel really proud when I scan them after finishing the project 😊!

Home page and the intro page:

For the home page, we have utilized the function “cursor”, so when the user moves the mouse to the title, the title will changes into color orange and when the user moves the mouse to the “START”, the color of the font will become orange as well and the cursor will be changed from arrow to hand so that users will know that it can be clicked.

As for the button “NEXT” in the intro page, besides the cursor function, it is actually a little animation. The little “NEXT” will gradually become bigger and when it is big enough, it will becomes small again. So it is a simple animation that is aimed to attract people’s attention so that users will easily notice that button and click it to continue.

 

Experiment Mode:

The experiment has two steps and the formulas we chose are as follows:

We have spent a lot of time on selecting a proper formula because we want a reaction that has both an apparent effect such as color change and a strict requirement for the volume of the chemicals involved. In the end, we chose the reaction between H2O2 and FeCl2 because depending on the portion of the H2O2, the reaction is actually different. For the first step, when H2O2:FeCl2=1:2, the result is only a color change. Fe3+is produced so the color of the liquid changes from light green to dark orange-red. While for the step2, when H2O2 is more than half of the FeCl2, there will emerge oxygen and users will see bubble floating out.

This is how the step 1 looks like:

According to the instructions, the user will first click on the button FeCl2 and measure 200ml water  and add it to our measuring cup. It won’t work when the volume is not correct. To make if easier for users to understand, when the “chemical” is FeCl2, there will be a little red circle beside the image like the screenshot on the left to inform the audience which “chemical” they are adding to the cup. Then the user will follow the instructions to add H2O2 and click the cup to mix them together. The color of the liquid will change when the reaction is finished like what is shown in the video below. (There is also demonstration in the demo)

 

In order to control which “chemical” is selected, we have set up two variables c1 and c2. After clicking each chemical, the value of c1 and c2 will change accordingly so that we can control which chemical is adding to the cup and demonstrate the changing volume of the liquid.

This is the part in the mouseClicked() function attached in the end of the code

 

As for the step2, the page is generally similar to the step 1, the biggest difference is the bubble part. When the user clicked the cup to mix the two chemicals together, there will be bubbles floating out like this:

For the bubbles, grace and I have struggled a lot about the classes. We have referred to many reference and we finally figured out how to do it (reference is in the reference section above).

The use of boolean is also one of our progress which we found is sometimes easier than if condition.

 

Magical Mode:

When the user entered the magical mode, it is more like a tricky little game.

User can click on different “chemicals” such as carrot juice, then there will be a magical “reaction” in the cup like what the image shows–carrot juice+milk=a bunny. (for fish it is a kitty while for banana it is a tiny monkey).

For the “?”, when the user clicks it, it is more like a prank 😂. The user will see his/her photo in the cup like this:

For this part, I mainly utilized the technique we learnt in class to use camera. However, it is a little pity that the size of the capture camera is fixed, so I cannot adjust it to the exact size of the cup. But I think it is still very interesting and surprising for users according to the feedback I have received.

 

DEMO

The video is a little bit too big so I have compressed it maybe a little bit too much. Here is a link to the complete one in goole drive:

https://drive.google.com/open?id=1UEAl4e5WDfIArRzVjTQORcskCphrRDkC

 

USER TESTING & LESSONS LEARNED

Though Grace and I have classes during the IMA show so we didn’t make it to the show which is very a pity, but we have conducted user testing among our friends both during our fabrication and after we finished the whole project.

Most our users find it interesting to see the reaction appearing on the screen, according to Luisa, one of the Freshman, she said that it was great fun to explore chemical experiments like this and she hoped that we could have more reactions in the future, which is also our expectation if we have more time. Also, many of them loved our magical mode especially the camera part because it was surprising for them and they found it funny to become “a result of an reaction”. Better than my midterm, this time all my users found the instructions easy to follow and they can finish each step without my reminding, which I think is a good sign of my progress in terms of making “user-friendly products”. They also loved our interface which is according to Doris, “cute and cute and cute”.

One of the suggestions we received is that maybe there should be more reactions for users to choose from and the formula might be a little to complex for kids. We will definitely work on that but it is a little hard to find a formula that both has an apparent effect and also an apparent visual effect depending on different volume, but we will make more efforts on it. Another suggestion is that maybe there can be more interactions and Grace and I are considering about adding “mixing by hands” instead of clicking the cup.

The lessons we learnt are mainly:

  1. User-friendly design is very important. Always think for your user, especially your target audience.
  2. Clear instructions and interface design that appeals to your users.
  3. Interesting interactions and give your user a little surprise.
  4. Organize the coding! Especially when you have a lot of different individual pages!
  5. When one way doesn’t work (the water pressure sensor), don’t panic, try another! 😁
FINAL REMARKS

Thanks for everything for this amazing semester and I really enjoy it! I like the way how I build interactions between physical touchable things and my computer! It’s like breaking down the wall between virtual world and the reality and luckily, I am the one who “build bridges” between these two worlds.

I will continue my journey in IMA and in the end  thank you, Professor Antonius for being the best professor! Patient and kind! ❤️ Hope to see you in the future! And also, thanks for all the amazing fellows and classmates!❤️

Arduino Part----------------------------------------------------------------------------------

//connect gp2d120x to A1
#define pin A1

void setup () {
        Serial.begin (9600);
        pinMode(pin, INPUT);
   
}

void loop () {
        uint16_t value = analogRead (pin);
        double distance = get_IR (value); //Convert the analog voltage to the distance
        int v=10-distance;
        Serial.write (v);

        delay (500);                            //Delay 0.5s
        
}

//return distance (cm)
double get_IR (uint16_t value) {
        if (value < 16)  value = 16;
        return 2076.0 / (value - 11.0);
       
        
}

Processing Part----------------------------------------------------------------------------------

import processing.serial.*;
import processing.video.*; 
Capture cam;

//String myString = null;
Serial myPort;
//int NUM_OF_VALUES = 1;   /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/ // This is the number of values you are receiving. 
//int[] sensorValues;      /** this array stores values from Arduino **/

ArrayList<Bubble> bubbles;
int add = 0;
int initial = 10;


PImage bg1,bg2,bg3,cup1,cup2,formula1,formula2,formula3,cat,cont1,cont2,cont3,ins,carrot,fish,banana,mystery,kitty,monkey,rabbit;
PFont myFont;

int mode=0;
float u=25;
float v1=0,v2=0;
float speed=0;
int c1,c2,c3,c4=0;
int c,b,f,m=0;


void setup(){
 fill(255);
 size(1280,780);
 bubbles = new ArrayList<Bubble>();
 cam = new Capture(this, 320, 240);
 cam.start(); 
  
 bg1=loadImage("bg.jpg");
 bg1.resize(1280, 780);
  
 bg2 =loadImage("bg2.jpg");
 bg2.resize(1280, 780);
 
 bg3 =loadImage("bg3.jpeg");
 bg3.resize(1280, 780);
 
 cup1=loadImage("cup.png");
 cup2=loadImage("cup2.png");
 
 formula1=loadImage("formula.png");
 formula2=loadImage("formula2.png");
 formula3=loadImage("formula3.png");
 
 cat=loadImage("cat.jpg");
 cat.resize(600,780);
 cont1=loadImage("cont1.png");
 cont2=loadImage("cont2.png");
 cont3=loadImage("cont3.png");
 
 ins=loadImage("instruction.png");
 ins.resize(600,500);
 
 //magic mode images
 
 carrot=loadImage("carrot.jpg");
 carrot.resize(110,110);
 
 banana=loadImage("banana.jpg");
 banana.resize(110,110);
 
 fish=loadImage("fish.jpg");
 fish.resize(110,110);
 
 mystery=loadImage("mystery.jpg");
 mystery.resize(110,110);
 
 kitty=loadImage("kitty.jpg");
 kitty.resize(270,340);
 
 monkey=loadImage("monkey.jpg");
 monkey.resize(270,340);
 
 rabbit=loadImage("rabbit.jpg");
 rabbit.resize(270,340);
 

 
 
 myPort= new Serial(this, Serial.list()[3], 9600);
  //setupSerial();
 
}

void draw(){

//updateSerial();
//printArray(sensorValues);


PFont font;
font = loadFont("Chalkduster-48.vlw");



//page 1 >>cover--------------------------------------------------------------------------
if(mode==0){

  
  image(bg1,0,0);
  fill(255);
  textFont(font, 40);
  text("START",1000,250);
  textFont(font, 70);
  text("#A MINI CHEMISTRY LAB#", 80, 150);

  
if(990<mouseX&& mouseX<1150 && 220<mouseY && mouseY<260){
  fill(#E88A2C);
  textFont(font, 40);
  text("START",1000,250);
  cursor(HAND);
}else if(70<mouseX && mouseX <1153 && 85<mouseY && mouseY<165){
  fill(#E88A2C);
  textFont(font, 70);
  text("#A MINI CHEMISTRY LAB#", 80, 150);

}else{
  fill(255);
  textFont(font, 40);
  text("START",1000,250);
  cursor(ARROW);
  fill(255);
  textFont(font, 70);
  text("#A MINI CHEMISTRY LAB#", 80, 150);
  textFont(font, 30);
}
}

//page 2 >>intro page-----------------------------------------------------------------------
if(mode==1){
  
  image(bg2,0,0);
  cursor(ARROW);
  
  fill(#F293C1);
  textFont(font, 70);
  text("WHAT CAN I DO : ) ?", 80, 150);
  
  textFont(font, 25);
  fill(0);
  text("* Welcome to this amazing tiny lab!!!",80,220);
  text("* Here you can explore some interesting chemical experiments safely, and",80,270);
  text("also acquire some basic knowledge about how to operate an experiment properly",80,320);
  text("* By following the instructions step by step, you will first complete some",80,370);
  text("real experiments and if you pass the exercise, you will enter a magical mode!",80,420);
  fill(#F293C1);
  text("* Interacting with physical laboratory equipments and check the process of ",80,470);
  text("your experiment on the screen! Try this project right now!",80,520);
  fill(0);
  textFont(font,u);
  text("<NEXT>",1000,620);
  if(u<=50){
    u=u+0.3;
  }else if(u>50){
    u=25;
  }
  if(900<mouseX&& mouseX<1200 && 590<mouseY && mouseY<640){
  fill(255);
  textFont(font,u);
  text("<NEXT>",1000,620);
  cursor(HAND);
}
}


//page 3 >>experiment 1---------------------------------------------------------------------
if(mode==2){
  
  if (100<mouseX&& mouseX<188 && 200<mouseY && mouseY<286 ||100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487){
  cursor(HAND);
    
  }else{
    cursor(ARROW);
  }
  
  background(bg2);
  image(cup1,100,200);
  image(cup2,100,400);
  image(formula1,250,50); 
  fill(0);
  textFont(font,23);
  text(">>EXPERIMENT 1",30,95);
  text("FeCl2",100,310);
  text("H2O2",100,510);
  textFont(font,18);
  text("(containing H+)",100,330);
  fill(#7CE3AC);
  text("blue-green liquid",100,360);
  fill(255);
  text("transparent liquid",100,540);
 
   
  //instruction bubble
  image(ins,270,150);
  fill(0);
  textFont(font,16);
  text("1. Click FeCl2, add 200 ml liquid to the cup,",370,330);
  text("click the image again when stop filling",370,360);
  text("2. Click H2O2, add 100 ml liquidto the cup",370,390);
  text("3. Click the cup to mix them together",370,420);
  text("4. Observe the color and click NEXT",370,450);
  
  noFill();
  stroke(0);
  rectMode(CORNER);
  rect(900, 230, 280, 320,0,0,60,60);
  fill(#7CE3AC);
  
  rectMode(CORNERS);
  noStroke();
  rect( 900, 550-v1,1180,550,0,0,60,60);
  strokeWeight(1);
  
  rectMode(CORNER);
  noFill();
  stroke(1);
  rect(900,230,280,v2);
  
  if(c1==1){
  while(myPort.available()>0){
    v1=myPort.read()*20;

  }

  }else
  
  if(c2==1){
   while(myPort.available()>0){
    v2= 320-myPort.read()*30;
    }
    if(v2>500){
      text(0,0,255);
      textSize(32);
      print("WARNING", 900,550);
    }
  }else
  
  if(v1>50 && v2>50 && c3==1){
    rectMode(CORNERS);
    noStroke();
    fill(#F05933);
    rect( 900, 550-v2,1180,550,0,0,40,40);
  }
  
  //next button
  
  fill(0);
  textFont(font,40);
  text("<NEXT>",1000,700);
  if(950<mouseX&& mouseX<1100 && 680<mouseY && mouseY<720){
  fill(255);
  textFont(font,40);
  text("<NEXT>",1000,700);
  cursor(HAND);
}

  
}

//page 4 >>experiment 2------------------------------------------------------------------

if(mode==3){
  

  background(bg2);
  image(cup1,100,200);
  image(cup2,100,400);
  image(formula2,250,50); 
  fill(0);
  textFont(font,23);
  text(">>EXPERIMENT 2",30,95);
  text("FeCl2",100,310);
  text("H2O2",100,510);
  textFont(font,18);
  text("(containing H+)",100,330);
  fill(#7CE3AC);
  text("blue-green liquid",100,360);
  fill(255);
  text("transparent liquid",100,540);
  
  //next button
  fill(0);
  textFont(font,40);
  text("<NEXT>",1000,620);
  if(900<mouseX&& mouseX<1200 && 590<mouseY && mouseY<640){
  fill(255);
  textFont(font,40);
  text("<NEXT>",1000,620);
  cursor(HAND);
}

   //instruction bubble
  image(ins,270,150);
  fill(0);
  textFont(font,16);
  text("1. Click H2O2, add another 100 ml liquid,",370,330);
  text("click the image again when stop filling",370,360);
  text("2. Click the cup to mix them together",370,390);
  text("3. Observe what happens to the liquid",370,420);
  text("4. Click NEXT",370,450);
  
  rectMode(CORNERS);
    noStroke();
    fill(#F05933);
    rect( 900, 550-v2,1180,550,0,0,60,60);
    if(c4==1){
  bubbles.add(new Bubble(random_generator()));
 
  //If bubble gets to the top it is removed
  for (int i = 0; i < bubbles.size(); i++){
    Bubble b = bubbles.get(i);
    b.ascend();
    b.display();
    if (b.top()){
      bubbles.remove(i);
    }
 
  }

}

  rectMode(CORNER);
  noFill();
  stroke(1);
  rect(900,230,280,v1);
  image(ins,270,150);
  noFill();
  stroke(0);
  strokeWeight(1);
  rectMode(CORNER);
  rect(900, 230, 280, 320,0,0,60,60);
  if (100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487){
  cursor(HAND);
    
  }else{
    cursor(ARROW);
  }
  if (c2==1){
    while(myPort.available()>0){
    v1= 320-myPort.read()*30;

  }
  
  
  
  
}


//page 5 >> magical mode intro------------------------------------------------------------------


if(mode==4){
  
  cursor(ARROW);
  background(bg3);
  image(cat,0,0);
  image(cont1,720,80);
  image(cont2,900,150);
  image(cont3,640,190);
  
  fill(0);
  textFont(font,18);
  text("Here you can experience some fantastic(weird) experiments!",640,400);
  text("Trust me they are amazing! Follow the instructions",640,450);
  text("and let's go ~~~~~",640,500);
  
   //next button
  
  fill(0);
  textFont(font,u);
  text("<NEXT>",1000,700);
  if(u<=50){
    u=u+0.3;
  }else if(u>50){
    u=25;
  }
  if(950<mouseX&& mouseX<1100 && 680<mouseY && mouseY<720){
  fill(255);
  textFont(font,u);
  text("<NEXT>",1000,700);
  cursor(HAND);
}
 

}



//page 6 >> magical mode experiment 1------------------------------------------------------------------

if(mode==5){
  
  if (100<mouseX&& mouseX<200){
  if(150<mouseY && mouseY<250||310<mouseY && mouseY<400){
    cursor(HAND);
  }else if(450<mouseY && mouseY<550||600<mouseY && mouseY<700){
    cursor(HAND);
  }
    
  }else{
    cursor(ARROW);
  }
  
  background(bg2);
  image(formula3,250,50); 
  
  println(mouseX,mouseY);
  image(carrot,100,150);
  image(fish,100,300);
  image(banana,100,450); 
  image(mystery,100,600);
  fill(0);
  textFont(font,23);
  text(">>MAGIC MODE ",30,95);
  
  textFont(font,18);
  text("Carrot Juice",100,280);
  text("Fish",100,430);
  text("Banana",100,580);
  text("Mystery",100,730);

  //instructions 
  image(ins,270,150);
  fill(0);
  textFont(font,16);
  text("Here is a cup of 400ml milk",370,330);
  text("Choose an element from the left",370,360);
  text("Click the cup to mix them together",370,390);
  text("Check what happens!!!",370,420);
  text("You can try other choices as well~~~",370,450);
  
  
  noFill();
  stroke(0);
  rectMode(CORNER);
  rect(900, 230, 280, 320,0,0,60,60);
  fill(#7CE3AC);  
 
  rectMode(CORNER);
  noStroke();
  fill(#FCFAFA);
  rect(900, 320, 280, 230,0,0,60,60);


  if(c==1){
  image(rabbit,907,200);
  }if(b==1){
  image(monkey,907,200);
  }if(f==1){
  image(kitty,907,200);
  }if(m==1){
     if (cam.available()) { 
   cam.read(); 
  } 
  pushMatrix();
  translate(cam.width, 0);
  scale(-1,1);
  tint(250,144,63);
  image(cam, -880, 300);
  popMatrix();
  noTint();
  
  
  
  
  }
  
 

  
  //next button
  
  fill(0);
  textFont(font,40);
  text("<DONE>",1000,620);
  if(900<mouseX&& mouseX<1200 && 590<mouseY && mouseY<640){
  fill(255);
  textFont(font,40);
  text("<DONE>",1000,620);
  cursor(HAND);
}

  
}
}

}

int random_generator(){
  int r = int(random(10, 100));
  return r;
  }
//MouseClicked functions------------------------------------------------------------------
void mouseClicked(){
  if (mode==0){
    if(990<mouseX&& mouseX<1150 && 220<mouseY && mouseY<260){
      mode=1;
    }
  }
      if (mode==1){
    if(900<mouseX&& mouseX<1200 && 590<mouseY && mouseY<640){
      mode=2;
    }
  }
  
  //page3
if(mode==2){
  if (100<mouseX&& mouseX<188 && 200<mouseY && mouseY<286 && c1==0 ){
    c1=1;
  
    
  }else if(100<mouseX&& mouseX<188 && 200<mouseY && mouseY<286 && c1==1){
    c1=0;
    }
    if (100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487 && c2==0 ){
    c2=1;
  
    
  }else if(100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487 && c2==1){
    c2=0;
    }
    else if(950<mouseX&& mouseX<1100 && 680<mouseY && mouseY<720){
      mode=3;
}
if(c3==0 && 900<mouseX&& mouseX<1180 && 230<mouseY && mouseY<550 ){
   c3=1;
 }
}

if(mode==3){
  if(900<mouseX&& mouseX<1200 && 590<mouseY && mouseY<640){
      mode=4;

}
if (100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487 && c2==0 ){
    c2=1;
  
    
  }else if(100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487 && c2==1){
    c2=0;
    }
if(c4==0 && 900<mouseX&& mouseX<1180 && 230<mouseY && mouseY<550 ){
   c4=1;
  }else if(c4==1 && 900<mouseX&& mouseX<1180 && 230<mouseY && mouseY<550){
    }
}

if(mode==4){
  if(950<mouseX&& mouseX<1100 && 680<mouseY && mouseY<720){
    mode=5;
  }
    if (100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487 && c2==0 ){
    c2=1;
  }else if(100<mouseX&& mouseX<188 && 400<mouseY && mouseY<487 && c2==1){
    c2=0;
    }
 
}



if(mode==5){
  if (100<mouseX&& mouseX<200 && 150<mouseY && mouseY<250){
    c=1;
    b=0;
    f=0;
    m=0;
  
  }else if (100<mouseX&& mouseX<200 && 310<mouseY && mouseY<400){
    c=0;
    b=0;
    f=1;
    m=0;
  }else if(100<mouseX&& mouseX<200 && 450<mouseY && mouseY<550){
    c=0;
    b=1;
    f=0;
    m=0;
    }else if(100<mouseX&& mouseX<200 && 600<mouseY && mouseY<700){
    c=0;
    b=0;
    f=0;
    m=1;
}  else if(900<mouseX&& mouseX<1200 && 590<mouseY && mouseY<640){
    mode=0;
  }
}

}

//bubbles
class Bubble{ 
  float x;
  float y;
  float diameter;
  float yspeed; 

  Bubble(float tempD){
    x = random(920,1160);
    y = 230;
    diameter = tempD;
    yspeed = random(2.5, 10.5);
  }
 
  //moves bubble upwards, and randomly from side-to-side
  void ascend(){
    y = y - yspeed;
    x = x + random(-2, 2);
  }
 
  //displays bubble
  void display(){
    noStroke();
    fill(231, 254, 255, 200);
    ellipse(x, y, diameter, diameter);
  }
 
  //checks if bubble is at the top of the screen
  boolean top(){
    if (y < 0){
      return true;
    }
    else{
      return false;
    }
  }
}

Emily Kramer – Final Project Documentation

Day One

  • Concept presentation: drawing robot that teaches middle school students how to code and build circuits
    • Initial version: students build the robot and circuits, then use Processing to control the robot’s movements
    • Guided by a physical instruction booklet
    • My final project will be an example of what a student could create given the instructions

Day Two

  • First round of feedback (from Cassie)
  • Best suggestion: use Processing to create an interactive instruction booklet rather than a physical booklet and have students deal solely with Arduino; makes a lot of sense and would probably alleviate a lot of confusion
    • Will base the booklet around videos of me putting together components
    • storyboard: 

Day Three

  • Started to make the videos of me putting together the robot itself
    • Materials: cup, markers, cut-up Styrofoam ball, 150 motor from Arduino kit, popsicle sticks
    • decided to have it so that motor will be pre-attached to cup, since kids will probably get frustrated trying to attach it themselves (it does take a lot of time and patience)
  • initial booklet instruction order: welcome screen, materials checklist, robot head, robot body video, robot composite video, breadboard-to-Arduino circuit video, breadboard circuit video, breadboard-to-motor circuit video, coding skeleton video, coding combination video, connection video, finished project video
    • Before each section (robot, circuit and coding), there will be text describing what the student will be doing
    • videos will feature some degree of explanation, especially the ones pertaining to the circuit
    • created a list of materials for each section and wrote down the specific steps for my videos for the first two sections (these will act as “scripts” for the videos)

Day Four

  • Second round of feedback (from Antonius and Tyson)
  • Look into block coding (available on the Arduino website, making the whole project even more accessible) to control the robot
    • Much easier than physically typing out the code and would mitigate frustration due to difficult syntax
    • The mix-and-match element might also encourage students to get creative with their own robot
  • Talk to other people about how best to create the transitions between the instruction videos; use paper prototyping
    • Should beginning materials checklist be words with check boxes or pictures that disappear when you click on them?
    • Should you click the screen or press a key to go to the next video?
  • Suggestions from Tyson: have the forward arrow key press to go to the next step
    • went with the spacebar instead (bigger)
  • Also not sure if I should include multiple examples or just one
    • ultimately had to go with just one example because of time constraints

Day Five

  • Used recitation time to explore the online block coding option ArduBlock
  • Definitely a headache to download
  • Have to decide how to configure the display of my project (whether to keep the instructions on the same computer that the user will use or have it run on a separate computer)
  • figured out that ArduBlock doesn’t work with the latest version of Arduino or the Arduino Uno board; as far as I know, the most recent version available for public download is the 2011 beta version
    • decided that instead of having program instruction videos, I would just have one screen with the actual Arduino code written out so that students could go back and forth between the instructions and their Arduino window as much as they need to, and because the syntax is so specific (they can copy-paste if they really need to)

Day Six

  • first figured out the circuit and Arduino code to control the motor speed with a potentiometer (got help from an Arduino for Dummies page)
  • filmed circuit videos (pretty straightforward)
    • split the circuit process into many videos because it’s a little more complex than the robot, and doing one or two steps per video can help keep things clear
  • started digital instruction booklet
    • first figured out how to create a series of screens where the user can go to the next screen by pressing the spacebar
    • IMG_1405 (video of progress so far)
  • finished booklet
    • inserted videos based on how we learned to do it in class
    • NOTE: at the time of user testing, the videos worked (please take my picture and video as proof), but after toggling with the code a little, they stopped working and I didn’t have time to fix it and film a new demo video. Here are the individual videos:
    • here are screenshots of the instruction booklet’s text screens:

Day Seven

  • user testing!
  • tested on my roommate Kate, because she had no prior experience in coding or electronics
  • I gave her the materials and had her go through the instructions to build her own robot
  • she had to go through twice, but she eventually did it
  • she responded well to the booklet, but had some good suggestions
    • I was most encouraged by the creative response she had; she immediately wanted to start making new things with Arduino, which to me represents the fulfillment of my original goal (to get kids excited about robotics and programming).
    • IMG_1380 (video of her with her final bot)
    • IMG_1381 (video of her feedback)

What I would do differently next time:

  • give myself more time and procrastinate less
  • do more organizational work and planning on the front end
  • do more user tests (preferably with actual kids)
  • try to make the instructions more visually attractive
int screen = 0;
PFont f;
import processing.video.*;
Movie amyMovie;
Movie bmyMovie;
Movie cmyMovie;
Movie dmyMovie;
Movie emyMovie;
Movie fmyMovie;
Movie gmyMovie;
Movie hmyMovie;
Movie imyMovie;
Movie jmyMovie;
Movie kmyMovie;
Movie lmyMovie;
Movie mmyMovie;
Movie nmyMovie;
Movie omyMovie;


void setup() {
  size(1000, 1000);
  f = createFont("Arial",14,true);
  amyMovie = new Movie(this, "IMG_1354.MOV");
  amyMovie.play();
  bmyMovie = new Movie(this, "IMG_1347.MOV");
  bmyMovie.play();
  cmyMovie = new Movie(this, "IMG_1355.MOV");
  cmyMovie.play();
  dmyMovie = new Movie(this, "IMG_1357.MOV");
  dmyMovie.play();
  emyMovie = new Movie(this, "IMG_1361.MOV");
  emyMovie.play();
  fmyMovie = new Movie(this, "IMG_1362.MOV");
  fmyMovie.play();
  gmyMovie = new Movie(this, "IMG_1364.MOV");
  gmyMovie.play();
  hmyMovie = new Movie(this, "IMG_1366.MOV");
  hmyMovie.play();
  imyMovie = new Movie(this, "IMG_1367.MOV");
  imyMovie.play();
  jmyMovie = new Movie(this, "IMG_1368.MOV");
  jmyMovie.play();
  kmyMovie = new Movie(this, "IMG_1369.MOV");
  kmyMovie.play();
  lmyMovie = new Movie(this, "IMG_1370.MOV");
  lmyMovie.play();
  mmyMovie = new Movie(this, "IMG_1371.MOV");
  mmyMovie.play();
  nmyMovie = new Movie(this, "IMG_1372.MOV");
  nmyMovie.play();
  omyMovie = new Movie(this, "IMG_1373.MOV");
  omyMovie.play();
}

void draw() {
  background(#39AEF5);
  textFont(f,14);
  fill(0);
  if(screen == 0) {
  text("Welcome! Today you'll be creating and programming your own drawing robot! This is your video instruction book.",10,100);
  text("In this project, you'll learn the basics of robotics, circuit-building, and coding.",10,150);
  text("Your teacher or acticity leader will hand out kits with all the materials you need.",10,200);
  text("This project will be divided into three sections: the robot, the circuit, and the code.",10,250);
  text("Make sure you pay attention to the checklist at the beginning of each section, so you know what you need to use.",10,300);
  text("Watch each video carefully and repeat the actions you see. After each step, press your spacebar to continue to the next step.",10,350);
  text("Let's begin. Good luck!",10,400);
  }
 if(screen == 1) {
   background(#0AF753);
   textFont(f,14);
   fill(0);
   text("Section One: Building Your Robot", 10, 100);
   text("In this section, you will be building the body of your robot in a few simple steps.",10,150);
   text("You will need:",10,200);
   text("3 markers",10,220);
   text("tape",10,240);
   text("cup with motor attached",10,260);
   text("styrofoam piece",10,280);
   text("popsicle stick",10,300);
 }
 if(screen == 2) {
   if (amyMovie.available()) {
    amyMovie.read();
  }
  image(amyMovie, 0, 0);
 }
 if(screen == 3) {
   if (bmyMovie.available()) {
    bmyMovie.read();
  }
  image(bmyMovie, 0, 0);
 }
 if(screen == 4) {
   if (cmyMovie.available()) {
    cmyMovie.read();
  }
  image(cmyMovie, 0, 0);
 }
 if(screen == 5) {
   if (dmyMovie.available()) {
    dmyMovie.read();
  }
  image(dmyMovie, 0, 0);
 }
  if(screen == 6) {
   background(#F21198);
   textFont(f,14);
   fill(0);
   text("Section Two: Building Your Circuit", 10, 100);
   text("In this section, you will be building the circuit that will power your robot.",10,150);
   text("Pay close attention to where the components are placed so that your circuit works!",10,200);
   text("You will need:",10,250);
   text("F/M wires (2 black, 2 red)",10,300);
   text("M/M wires (4 black, 4 red, 1 green, 1 blue)",10,350);
   text("breadboard, Arduino board and connector cable",10,400);
   text("150 motor, diode and transistor",10,450);
   text("220 ohm resistor, potentiometer and potentiometer knob",10,500);
 }
 if(screen == 7) {
   if (emyMovie.available()) {
    emyMovie.read();
  }
  image(emyMovie, 0, 0);
 }
 if(screen == 8) {
   if (fmyMovie.available()) {
    fmyMovie.read();
  }
  image(fmyMovie, 0, 0);
 }
 if(screen == 9) {
   if (gmyMovie.available()) {
    gmyMovie.read();
  }
  image(gmyMovie, 0, 0);
 }
 if(screen == 10) {
   if (imyMovie.available()) {
    imyMovie.read();
  }
  image(imyMovie, 0, 0);
 }
 if(screen == 11) {
   if (jmyMovie.available()) {
    jmyMovie.read();
  }
  image(jmyMovie, 0, 0);
 }
 if(screen == 12) {
   if (kmyMovie.available()) {
    kmyMovie.read();
  }
  image(kmyMovie, 0, 0);
 }
 if(screen == 13) {
   if (lmyMovie.available()) {
    lmyMovie.read();
  }
  image(lmyMovie, 0, 0);
 }
 if(screen == 14) {
   if (mmyMovie.available()) {
    mmyMovie.read();
  }
  image(mmyMovie, 0, 0);
 }
 if(screen == 15) {
   if (nmyMovie.available()) {
    nmyMovie.read();
  }
  image(nmyMovie, 0, 0);
 }
 if(screen == 16) {
   if (omyMovie.available()) {
    omyMovie.read();
  }
  image(omyMovie, 0, 0);
 }
 if(screen == 17) {
   background(#FCA25C);
   textFont(f,14);
   fill(0);
   text("Section Three: Programming Your Robot",10,100);
   text("In this section, you will be writing the code that will allow you to control your robot!",10,150);
   text("The next screen will show you the code you need to write in your Arduino window.",10,200);
   text("Make sure you write exactly what's on the screen, or the code might not work. Pay attention to capital letters!",10,250);
   text("In places where you see a single quotation mark, be sure to type a double quotation mark instead.",10,300);
   text("Press the spacebar to continue.",10,300);
 }
 if(screen == 18) {
   background(#B043F5);
   textFont(f,14);
   fill(0);
   text("int potentiometerPin = A0;",10,100);
   text("int motorPin = 9;",10,120);
   text("int potentiometerValue = 0;",10,140);
   text("int motorValue = 0;",10,160);
   text("void setup() {",10,180);
   text("Serial.begin(9600);",20,200);
   text("}",10,220);
   text("void loop() {",10,240);
   text("potentiometerValue = analogRead(potentiometerPin);",20,260);
   text("motorValue = map(potentiometerValue, 0, 1025, 0, 255);",20,280);
   text("analogWrite(motorPin, motorValue);",20,300);
   text("Serial.print('potentiometer= ');",20,320);
   text("Serial.print(potentiometerValue);",20,340);
   text("Serial.print('t motor= ');",20,360);
   text("Serial.println(motorValue);",20,380);
   text("delay(2)",20,400);
   text("}",10,420);
 }
 if(screen == 19) {
   background(#39AEF5);
   textFont(f,14);
   fill(0);
   text("Congratulations, you're almost finished!",10,100);
   text("Now, just connect the Arduino to your computer by plugging the connector cable into a USB port.",10,150);
   text("In the Arduino window, click the Upload button to upload the code to the Arduino.",10,200);
   text("If there are problems with the code, Arduino will tell you what they are before it finishes uploading.",10,250);
   text("Once the code uploads, you can control your robot's speed by turning the knob on your potentiometer.",10,300);
   text("Enjoy your robot! You can keep experimenting with code and circuit components to find your favorite way to control the robot.",10,350);
 }
}

void keyPressed() {
  screen = min(screen + 1, 20);
}

IxLab: Final Project!

Partner: Jessica Chon

Project Title: Divine Intervention

Inspiration & Ideation

This project, in its earliest form, was a continuation of our midterm, the Kill Me Not Flower. The user feedback we received during the midterm motivated us to continue developing that project. One of the main feedbacks we focused on from the midterm was that many users tended to focus on only one aspect of our project (either the light or the water) because the components were spread out too much and not well integrated. Another lesson we kept in mind from the midterm was how we ran into problems the night before the in-class presentation because of my servo motor.

 

Concept Development

Moving forward from the midterm, Jessica and I talked to each other a lot about possible ideas for the final. We both agreed that we wanted to incorporate some new elements of Processing we had learned, namely sound, to add more interactivity to our project. At first, we toyed with the idea of having a physical butterfly that contained a microphone so that if the user blew on it, the butterfly would actually fly away. We realized from talking to one of the fellows that butterflies are actually very pretty and if the user saw one, they probably wouldn’t think to blow it away from the flower. So, we decided to make it a fly instead. Jessica did some research and found out that the Whitefly is a common pest to indoor plants. Further considering the potential applications of the microphone as an input, Jessica came up with the idea to have flies appear on the sky/window display such that they gradually grew in number until being blown away by the user.

As for my own development of the sky/window display, I was focused on two specific pieces of feedback from the midterm. One of them was for there to be some kind of base state that would always be there. The second was for the sky display to change not just from the user shining a flashlight on it, but also from the user covering up the flower. To be clear, this also occurred in the midterm but it was done with lerping and simply changed the brightness of the screen.

 

Coding & Building

Processing

When I first started working on the Processing sketch for the sky display, I thought I should make the clouds more realistic looking, so I started swapping out different cloud png’s and seeing how they looked. However, during the concept presentation in class, people said that they had liked the animated/cartoon-ish look of the original sketch. Because of this, I went back to the original cloud image that I used for the midterm. As for the sun, I decided to change to a different image of a sun that I found online. In the original midterm code, the sun would spin as a form of feedback for the user so they knew that shining the light on the plant was having some effect. However, some people gave feedback that this spinning didn’t really make sense in terms of the effect that light would have on a plant. As such, I decided to eliminate the spinning animation.

One feedback I got from Rudi during a recitation was that the various components of the project were still too disjointed. He pointed out to me that when a plant gets too much light, it’s a bad thing, and that I should reflect that somehow on the screen. He also said that it would be better if when the plant was watered, something happened on the sky screen as well. As a result, I ended up moving away from the clouds I had previously been focusing on and found images on google of a bright sunny sky, a nighttime sky, and a desert. The idea was to set light thresholds so that when it was around the normal amount of light usually in the room, the sky would be bright and sunny. If the user shines too much light on the plant’s built-in LDR sensor, the sky turns to a dessert. To integrate the water, I decided that once the plant was watered, it would cause rain on the screen. I got help from this YouTube video with the rain animation code: https://www.youtube.com/watch?v=Yg3HWVqskTQ&t=693s . I looked at several videos and code websites but ultimately this video was the most helpful to me.

Once I integrated Jessica’s code for the flies into the sky, I needed to figure out a way to add a delay so that time could pass before the flies would start to reappear again. Our worry was that if the flies immediately reappeared, the user would just keep blowing them away to get rid of them and never explore other parts of the interaction. I had the idea to do this using a boolean and start counting frames from the time when the microphone input volume exceeded the threshold set. Luis worked with me to figure out how to set the conditions so this would result in the delay I hoped for.

Arduino

Coding for the LDR sensor was easy because I already had experience working with the LDR for my midterm project. As for the water sensor, Jessica helped me with the code for that since she had worked with a water sensor for the midterm. I had to adjust the code a little bit in terms of naming variables and sending the water value to my Processing sketch with serial comm.

At first, I thought I was going to work with a ultrasonic range sensor for my project, so I spent some time figuring out how the coding for it worked. I was pretty confused at first, because I based my code off of the example on the Arduino website and didn’t really understand how each line of code was functioning. The purpose of using the distance sensor was to know whether or not there was a user standing in front of the project, so that some light changes alone wouldn’t set off the animation I had originally planned to create. However, during class when I asked Antonius a question about my coding, he pointed out to me that I was overcomplicating the process quite a bit. In fact, as it turned out I could accomplish what I wanted to without using the distance sensor at all! This made my life a lot easier.

Serial Communication

The serial communication was pretty straightforward for this project. I needed some help getting the Arduino code working for the sending of multiple values to my Processing sketch. Nicholas showed me I was writing println() when I should have just been writing print(), and this affected how Processing was receiving the values. Once I fixed this, my serial communication worked fine.

Building & Setup

For the flower petals, we kept the flower from our midterm project. I bought the flower pot off of Taobao and we cut a hold in the bottom of it to run our USB cables through to our computer. The stem of the flower is new for this iteration and is a bubble tea straw covered in polymer clay. The dirt for the flower is made of brown polymer clay. Two boxes were used to create the height difference we needed so that both screens could be visible.


                 

User Testing

We conducted the User Testing on our own for this project as was required. The first test was a bit of a fail, as when I detached and reattached my computer’s display screen, the Arduino stopped communicating with my computer and none of the animations of the sky were happening. Luckily, our user tester was very friendly and patient. He was confused about which part of the project he should interact with first, as were our second and third user testers. This made us realize that we needed to write instructions for our users. Due to time constraints, we didn’t do this before the final presentation. As a result, many of our peers wrote on the comments sheet that they thought our project definitely needed instructions.

In addition to this, one of our user testers remarked that even though he knew to blow on the microphone, it probably wouldn’t be intuitive to other users to blow toward the microphone instead of directly at the screen where the flies were appearing. For the IMA show, we made a small sign pointing toward where the user should blow. In the future, it would be great to have this sensor on the flower so that the user’s most instinctual behavior resulted in the flies going away.

The last feedback that I want to note is that users did not recognize our moisture sensors as roots, and they remarked that they wished the water could go directly into the “dirt”. If we were working with a plant that would be used with much longer time between each use, I think we could have tried out having some real dirt or a more realistic simulation of dirt that the user could pour water onto. In this kind of situation, the dirt (real or fake) would have ample time to dry, thus letting the sensor reading return to zero. However, as this was a version that needed to be tested over and over again (and used over and over within a short time span at the IMA show), it didn’t make sense to put the moisture sensors somewhere that we couldn’t easily access them and dry them off. For the record, Jessica used her knowledge of dyes to try and dye our sponges brown so that when we wrapped them around the moisture sensors, they could look more like roots. We ended up with an orange color that we simply did not have time to fix because of other things that needed to be tended to.

 

IMA Show

Setting up for the IMA show 🙂

Even though it was after the presentation of our project, the IMA show was the place where we got the most user feedback. It was nice to see the looks of amazement on some little kids faces when they blew the flies away or made the sky turn to nighttime. One challenge we did not anticipate was the decent number of people coming to the show who only spoke Chinese. I was able to communicate with them and through trial and error I figured out how to best articulate the purpose of our project using Chinese. I feel like this experience really tested my ability to clearly and concisely explain what our project was about, since not only was I talking to a total stranger, but I was forced to communicate in a simpler way because I do not know any vocabulary about circuits or interactive technology in Chinese. Also, blowing on the flies got a little bit tricky during the show. Because the input value for this is received from the microphone in my computer and the room got quite noisy, I think that’s why sometimes it would randomly start raining. This could have been fixed by taking some time to adjust the thresholds for the volume value that makes the flies disappear. However, I was reluctant to make changes to my code in the middle of the show since it was working for the most part.

 

Final Thoughts

After having the chance to present at the IMA show, I am still left with many ways I would like to improve our project if we were to make more iterations. I would definitely try and integrate the microphone into the flower so that the user could blow toward the flower to get the flies to go away. An interesting thing I observed during the IMA show was that even though we had instructions, not many readers read them. So, I would figure out a more obvious place to put the instructions, or I would build them into the Processing sketch so that they were embedded within what the user was interacting with. Also, I would like to create a Chinese version of the instructions so that even more people could enjoy the interaction.

Overall, the looks of surprise and happiness on the users’ faces at the IMA show made all the efforts from the semester feel even more worth it, and I am left with an extra component to my personal definition of interaction. Now, more than before, it’s more clear and obvious to me how important the user’s feeling is during the moment when they first interact with something. Of course this varies depending on the interaction– with something like a computer keyboard, we (or at least I) don’t have any consistent feelings on a conscious level about the feedback I get from the computer– that is, when I press “A” and the “A” shows up on the screen, I am not totally amazed and excited and awestruck. If this weren’t to happen, I would get frustrated and angry. However, when moving beyond keyboard and mouse for interacting with digital media, I can tell it is more likely the user will be surprised when finding out about some new behavior they can use to get some response from the digital media, even if it is a simple response, such as the screen going dark or some flies disappearing. In the end, I am excited to see in the future what kinds of human behaviors could eventually become as second-nature to us for interacting with media as a button press is now. Thanks very much to Antonius and all of the fellows (especially Nicholas and Luis– whom I bothered most frequently) for guiding me through the learning process this semester and helping me gain this kind of appreciation for interactive media.

 

//Arduino


int sensor1 = 0; //connect light sensor to A0
int sensor2 = 1;
int val1;
int val2;
int moisturePower = 7;



void setup() {
 // put your setup code here, to run once:
 Serial.begin(9600);

pinMode(moisturePower, INPUT);
 digitalWrite(moisturePower, LOW);



}

void loop() {
 // put your main code here, to run repeatedly:
 val1 = analogRead(sensor1) / 4;
 val2 = analogRead(sensor2) / 4;
 Serial.print(val1);
 Serial.print(",");
 Serial.print(val2);
 Serial.println();
 delay(100);
}
//
//int readMoisture() {
// digitalWrite(moisturePower, HIGH);
// delay(10);
// val2 = analogRead(sensor2);
// digitalWrite(moisturePower, LOW);
// return val2;
//}

 


			
import processing.serial.*;

ArrayList<Fly> manyFlies;

import processing.sound.*;

AudioIn input;
Amplitude amp;

PImage photo, sunny, night, desert;

Serial myPort; 
String myString = null;
//int val1;
PImage Sunimg;
PImage Cloudimg;

int tooBright, tooDark;

Drops d[];

boolean flygone = false;
int gonetime;

int SUNSIZE = 679;
boolean growing = false;
int growtime;

boolean using = false;
int usetime;

int NUM_OF_VALUES = 2;
int[] sensorValues;

boolean cloudparting = false;
int parttime;
int timer = 0;

float c;
float g;

void setup() {
  size(displayWidth, displayHeight);
   setupSerial();
  d=new Drops[6000];
  for (int k=0; k<6000; k++) {
    d[k] = new Drops();
  }
   sensorValues[1] = 1;
  c = 0;
  //loading fly image
  photo = new PImage();
  photo = loadImage("fly.png");
  photo.resize(0, 100);
  sunny = new PImage();
  sunny = loadImage("sunny.jpg");
  night = new PImage();
  night = loadImage("night.jpg");
  desert = new PImage();
  desert = loadImage("desert.jpg");


  manyFlies = new ArrayList();
  manyFlies.add(new Fly());
  manyFlies.add(new Fly());
  manyFlies.add(new Fly());
  manyFlies.add(new Fly());
  manyFlies.add(new Fly());
  manyFlies.add(new Fly()); 

  //audio setup
  input = new AudioIn(this, 0);
  input.start();

  amp = new Amplitude(this);
  amp.input(input);
}

void draw() { 
  updateSerial();
  printArray(sensorValues);
  //make images smaller than 3000 x 2000

  if (sensorValues[0] <= 200 && sensorValues[0] > 70) {
    image(sunny, 0, 0);
  } else if (sensorValues[0] > 200) {
    image(desert, 0, 0);
  } else if (sensorValues[0] <= 70 && sensorValues[0] > 0) {
    image(night, 0, 0);
  }

  if (sensorValues [1] >= 180) { 
    //INSERT JESSICA CODE HERE
    fill(220, 220);
    rect(0, 0, displayWidth, displayHeight);
    for (int i=0; i<6000; i++) {
      d[i].display(); 
      if (d[i].ydrop>height) {
        d[i] = new Drops();
      }
    }
  }

  windowPane();

  float volume = amp.analyze()*100;
  //println(volume);*/
  //loops through every fly of manyFlies
  for (int i = 0; i < manyFlies.size(); i++) {

    //gets one of the many flies and draw it and move it which is called from other tab "Fly"
    Fly oneOfManyFlies = manyFlies.get(i);
    oneOfManyFlies.showFly();
    oneOfManyFlies.moveFly();
  }
  //print(frameCount);
  //print(":");
  //println(gonetime);
  //depending on random, lets get more flies
  if (gonetime < frameCount && timer == 1) {
    println("here");
    //if (random(1)<0.2) { //&&  frameCount > gonetime+6000
    manyFlies.add(new Fly());

    //}
  }

  //if you blow, flies will go away
  if (volume >= 30) {
    //loop previous loop backwards
    if (!flygone) {
      flygone = true;
      gonetime = frameCount +200;
      timer=1;
    }
    for (int i = manyFlies.size()-1; i >= 0; i--) {
      //remove flies
      manyFlies.remove(i);
      flygone = false;
      volume = 0;
    }
  }


  //println(volume);
}


void setupSerial() {
  //printArray(Serial.list());
  myPort = new Serial(this, Serial.list()[0], 9600);

  myPort.clear();
  // Throw out the first reading,
  // in case we started reading in the middle of a string from the sender.
  myString = myPort.readStringUntil( 10 );  // 10 = 'n'  Linefeed in ASCII
  myString = null;

  sensorValues = new int[NUM_OF_VALUES];
}

void updateSerial() {
  while (myPort.available() > 0) {
    myString = myPort.readStringUntil( 10 ); // 10 = 'n'  Linefeed in ASCII
    if (myString != null) {
      String[] serialInArray = split(trim(myString), ",");
      if (serialInArray.length == NUM_OF_VALUES) {
        for (int i=0; i<serialInArray.length; i++) {
          sensorValues[i] = int(serialInArray[i]);
        }
      }
    }
  }
}

//rain 
class Drops {

  float xdrop, ydrop, speed;
  color q;
  Drops() {
    xdrop = random(width);
    ydrop = random(-1000, 0);
    speed = random(5, 10);
    q = color(255,255,255);
  }
  
  void update(){
   ydrop += speed; 
  }
  
  void display() {
   fill(q);
   noStroke();
   rect(xdrop, ydrop, 2, 15);
   update();
  }
}

//window pane
void windowPane() {
  stroke(0);
  fill(0);
  rect((width/2)-30, 0, 60, displayHeight); //vertical pane
  stroke(0);
 fill(0);
  rect(0, (height/2)-30, displayWidth, 60); //horizontal pane
   fill(0);
  rect(0, 0, 90, displayHeight); //left-most pane
   fill(0);
  //fill(255, 255, 255); 
  noStroke();
  rect(displayWidth-90, 0, 90, displayHeight); //right-most pane
  rect(0, 0, displayWidth, 70); //top pane
  fill(0);
  noStroke();
  rect(0, displayHeight-70, displayWidth, 70); //bottom pane
}

//flies


class Fly {
  //initial variables for fly
  int x;
  int y;
  float r;


  //constructor makes my fly
  Fly() {
    x = width/2;
    y = height/2;
    
    //used to make fly rotate random positions
    r = random(0, 2*PI);
  }


  //showing fly
  void showFly() {
    //image(photo, x, y);
    
    pushMatrix();
    translate(x, y); 
    rotate(r);
    image(photo, 0, 0);
    popMatrix();
  }

  void moveFly() {
    //move fly
    x = x + floor(random(-40, 40));
    y = y + floor(random(-40, 40));
  }
}

Interaction Lab Final Project

5/17/18

Partner: Maudie Carey

For Maudie and I’s final project, we decided to do a continuation of our midterm. After receiving much helpful feedback from user testing for our final and learning new material in class, we decided we could really improve our midterm.

What Our Midterm Was and What We Wanted to Change

Our midterm was a flower meant for people to who wanted to take care of a plant, but didn’t want to face the consequences of possibly killing a real plant. In the midterm, we had the plant rotate based on light values it was receiving, while an animation of the sun was playing in the background. Additionally, we had the flower that was wilting raise when you “watered” it that also had an animation of rain playing based on moisture values.

A lot of the feedback we heard about the project was about how people couldn’t really see/focus on the animations because they were so engrossed with the physical reactions of the plant and how it would be nice if the animations were more realistic. With this feedback in mind, Maudie and I decide to make the following changes for the final:

  • change our animations to make them more realistic and work better
  • take out the physical changes of the flower so users could focus more on the animations
  • somehow add wind/sound into the project
  • make movable curtains
  • project our animations

Sadly, we were unable to add the last two changes into our project but we were able to achieve the first three, which will be discussed in the rest of the documentation.

Arduino and Moisture Sensor

Materials:

  • moisture sensor
  • cable wires
  • arduino
  • breadboard

Because in the midterm I handled most of the moisture sensor and rain aspects of the project, I mostly just used code from the midterm. However, because I no longer needed a servo, I took out the code for that. So in terms of coding, the work was very simple.

But as I was working with the moisture sensor, I was reminded of how fickle/annoying it was to work with the values. One of the main issues I ran into in the midterm was how inconsistent the moisture values were because no one could tell how much water a user would spray on the plant, or how well I was able to dry the moisture sensor. I really wanted to fix this problem in the midterm, and Maudie helped come up with the solution which I’ll discuss later in the documentation.

Processing 

For the work with Processing, my work was divided into two parts: fixing the water animation and creating an animation that related to sound and wind.

Originally, Maudie and I thought we could incorporate wind into the project by having an animation of a flower sway when the user blows into the microphone. After discussing the idea, we came across the question of “how are we going to make users intuitively know to blow into the microphone”. So, we changed out idea into blowing away a pesky bug. After researching, I found that white flies are harmful to plants because they suck on the plant and make the plant get sick. So, I decided to use a picture of white flies that would be blown away but would continuously come back.

I started working on the code for making the flies move. What I had set in mind was that the flies would come in from the edge of the screen, flying towards the center where the flower would be. Initially I was using an array to make multiple flies, but I didn’t know how I would make each individual fly be positioned and move in a specific way. During recitation, I asked Tristan for help and we had to use a lot of trigonometry to figure out the formula to get the flies to face the center.

After getting the flies to face the direction I wanted them to be, I needed help on getting each fly to move towards the center. I set up an appointment with Antonius but after explaining what I was doing, he told me that I was going about this idea in a much more complicated way. He suggested that I use objects and classes for my coding, and proceeded to do an example with me so that I could understand. After the appointment, I looked at the code that we did together and replaced the necessary changes so that it fit what I needed with sound and flies. Although the animation was different from what I had in mind, this animation was a lot more realistic to how flies behave (which is super gross). Below is a video of getting the flies to work.

 

Now that I finished the code for the flies, I sent them to Maudie because we had to place the flies on her screen since she was the sky.

The second part of what I had to do was fix the animation for the water sensor. Originally, I had an overhead view of the grass and raindrops fell down based on the moisture sensor values. Although I thought this animation was very pretty, I decided to scrap it altogether and replace it with an animation that looked like a cross-section of the flower pot in order to give it a much more realistic and immersive look. The coding for this was fairly simple since it was a lot of images. I took a picture of the pot and the table of the IMA desks so that what was on the screen reflected real life. I photoshopped some roots together and put that into Processing also. The only thing that was not an image was the soil in the pot, which got darker the wetter the roots got. I also decided to add a photo of rain that would appear on the roots when the user started watering the plant to give an immediate indication to the user that what they were doing was working.

At this point, Maudie and I had gotten the bulk of what we needed to do finished, so we got some people to test our project. One of our users was of course, Antonius, and he told us that it was really nice how users were able to control the environment. But one of his suggestions was to also get the environment to change based off the moisture sensor values on Maudie’s screen, and not just mine. So, with his advice, we got another moisture sensor for Maudie’s project and she wrote code to make it rain on the screen when users watered the plant.

Continue reading

import processing.serial.*;

Serial myPort;
int valueFromArduino;

//dirt colors
int dr = 178;
int dg= 113;
int db = 7;

PImage table;
PImage pot;
PImage roots;
PImage water;

void setup() {
  size(displayWidth, displayHeight);

  printArray(Serial.list()); 
  valueFromArduino = 1;
  myPort = new Serial(this, "COM4", 9600);

  //table
  table = loadImage("table.jpg");

  //pot
  pot = loadImage("pot.png");

  //roots
  roots = loadImage("roots.png");
}

void draw() {
  background(255);

  //table
  image(table, 0, height/2, displayWidth, height/2);

  pushStyle(); //used to make the style only apply to what is inbetween pushStyle and popStyle
  imageMode(CENTER);
  //pot
  image(pot, width/2, height/2, width/2+ width/7, height/2+ height/5);

  //dirt in pot
  fill(dr, dg, db); 
  rectMode(CENTER);
  rect(width/2, height/2 - 70, 950, 750);

  //roots
  image(roots, width/2 + 200, height/2 - 220, 1500, 1000);

  while (myPort.available() > 0) {
    valueFromArduino = myPort.read();
    println(valueFromArduino);
  }

  //if and else if statements to get dirt color changing depending on arduino values
  if (valueFromArduino >= 120) {
    if (dr > 115 && dr <= 178) {
      dr-=5;
      dg-=5;
      db-=5;

      //watering plant image
      water = loadImage("rain.png");
      image(water, width/2 + 750, height/2 - 600, 500, 500);
    }
  } else { //default state of dirt 
    if (dr < 178) {
      dr+=5;
      dg+=5;
      db+=5;
    }
  }
  popStyle();
}

The DigiSteenbeck – Interactions Lab Jeffrey Han

The Problem

The the modern day of technology, it is very difficult to keep people’s attention.  It takes more and more effort to make people interested with the world.  Film is something that is suffering from this.  People are going to the cinema less frequently because the movie going experience is just not interesting enough anymore.  The film industry is resulting to cheap tricks like 4DX or comfy seats to keep viewers in the theater.  At the same time, with VR and AR technology highly rising, simply watching a film or video is not extraordinary enough anymore.  At the same time, the process of editing a film has devolved from cutting a physical film to simply pressing buttons and clicking a mouse.  Movie making and movie watching is supposed to be a fun and engaging experience, but this is slowly started to change for the worse.

The Solution

In order to revolutionize the movie experience, we here at JRJH Productions believe the key is to make it interactive.  The viewers can interactive with the film or video itself so they can choose what they see on screen.  We want to creative a device in which the viewer can physically interact with the film in which they can change angles, focal length, or even the location, as if they are the director of the film.  This way, the movie experience can be more engaging.  At the same time, this device can also be used for editing, so the editor can have a more hands on experience.  Sort of like VJing (DJing but with video).

The Inspiration

To Design this device, we looked at the age of 35mm film and the flatbed editing system.  Back when film was not edited on a computer, people used a flatbed in which they must physically cut film.  Coincidentally, many also considered this the “golden age” of Hollywood.  A famous company that made flatbeds is called “Steenbeck”.

For this project, we want to take the old classic design of the Steenbeck and make it modern.  So we present you with — The DigiSteenbeck.

The Design

We used Adobe Illustrator to design the DigiSteenbeck, which will then be laser cut with thick 3mm cardboard.  The design uses three “film rolls” as controls for the device.  Each of them will control pan, tilt, and zoom respectively.  There will also be a “film strip” in the middle so that the user can place different film clips into the timeline to affect what will show up on screen.  We wanted the device to look modern yet retro and classic at the same time.

The Production

When making the device, we encountered many problems, the first being laser cutting.  When cutting the board the first time, the laser cutter was cutting on 5mm thick board while on a 3mm setting.  Joel and I, nor the IMA fellow, realized this until we ran the cut twice.  The smell of the laser cut was also horrible to bare.

Later that day, we had our second laser cutting attempt.  This time we paid extra attention to the settings and eventually got it right.  However, the pieces were still not completely cut through so we had to tear some of them off the board.

After cutting the schematics out, we had to put the board together.  This was a fairly straightforward process.

The Medium

For this specific project, we decided to use dance as our film.  Dance is such an elegant form of art that really must be appreciated through different angles and locations to really be able to see its complete beauty.  We collaborated with three pairs of professional dancers who performed the same piece in three iconic locations in Shanghai — EXPO Park, The Bund, and BingJiang Avenue.  As filmmakers, we wanted the cinematography to be grand.  We shot different versions with different angles, but in the end, we decided to only use the extreme wide shot for the DigiSteenbeck, so the viewer can choose to zoom and to see the details.

The Circuit & Coding

The circuit design of this project is actually pretty simple.  We had three potentiometers which operated separately, and a RFID tag to control the different videos.  Coding the device was a lot more complicated.  We quickly realized that Processing is a horrible way of loading video.  We shot our dance films in beautiful 4K, but had to compress them into tiny 720p 10mb files in order for Processing to actually load them.  This was a huge disappointment, but it was something we cannot change anymore.

Coding wise, the most annoying part was to figure out the boundaries of the zoom pan and tilt.  Because we had to zoom in with a potentiometer, the boundaries of the film will continue changing.  Therefore, we cannot map our values to a single number, and instead must map it to a math equation.  Joel and I got two of our math major friends to figure out this equation for us.  But even after we got the equation, we somehow had to implement it into the code.  This was another impossible challenge for us.  Joel and I took turns sitting down the Luis to try and figure out this equation.  It took us three hours, and still there was no perfect solution.  In the end, the system works perfectly at 2x zoom, and okay-ish at 1.3 to 1.9.  However there is this threshold at 1.1-1.3 in which it still glitches.

The Final Device

After weeks of hard work, we finally finished the DigiSteenbeck.

This elegant device attracted many people’s attention in the IMA, being praised for its design.

Initial Responses & New Changes

After some user testing, we received really positive feedback for our project.  However, some people said that this is still a very singular experience.  Only one person and play with the DigiSteenbeck at once.  This gave us the idea to add more functionality to it by adding keyboard functions.  This way, one person can use the DigiSteenbeck, and another user can use the keyboard.  This will make the experience a collaborative process, something that is highly emphasized in filmmaking.  We added functions such as color filters, slow motion, and music change that can all be activated on the keyboard.

When we tested out this version of the project, people loved it even more, but said that it would be cool to have a second device to play with instead of simply using the keyboard.  We couldn’t agree more, but because of time constraints, we couldn’t put together and laser cut another device, so we kept the keyboard.

But after this, we realized that we must have a set of instructions so the user knows what is going on.

Presentation Responses

Joel and I were really nervous before the final presentation because we had no idea what people would have thought.  However, the reaction and comments were really positive and it gave use a big relief.  I loved Nemrah’s comment that this could actually be something she would see in a museum exhibit.  It felt good to get this recognition considering we are filmmakers and not programmers or designers.

IMA Show and User Testing

During the IMA Show, we put our stand right next to the door, and thankfully this attracted huge crowds at our station.  The audiences were very intrigued by our invention, and many even wanted to take a picture of it.  This was a special feeling because when someone wants to take a picture of this artwork, it means we are doing something right.

However after many visits to our stand, we realized a trend of problems.  The first one being we only wrote our instructions in English.  We forgot the fact that we are in Shanghai and many visitors may only speak and read Chinese.  So many of the Chinese viewers had no idea was going and I had to verbally explain to them what to do.  Our labels Tilt, Pan, and Zoom were also only in English.  But even so, we did not realize that might have been film jargon.  Even some English speakers who understood the instructions did not know what the different wheels were supposed to do.

Another problem was with loading in the film clips.  On the film strip, we had three frames.  The middle frame was empty and had the RFID under it.  We thought and empty frame would be very straightforward and mean that this is where they should load the clip, but people still tried loading the clips in the other frames, which already has images on them.

However, other than that, I am really pleased with the project.  I do believe the functionality can be clearer, and if I were to do this project again, I will make sure that is the case.

But in the end, I just want to thank Antonius for this great semester, and all of the IMA Fellows for their support!

//DIGISTEENBECK PROCESSING CODE
import processing.serial.*;
import processing.video.*;
import processing.sound.*;

String myString = null;
Serial myPort;
//char valueFromArduino;
SoundFile m1, m2, m3;
Movie Ch1, Ch2, Ch3;
Movie Chapter = Ch1;
PImage helpimg;

int x, y, w, h, vid, counter;
float zoom, pan, tilt;

int NUM_OF_VALUES = 4;   /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/
int[] sensorValues;      /** this array stores values from Arduino **/

void setup() {
  background(0);
  helpimg = loadImage("DigiSteenbeck Instructions.jpeg");
  imageMode(CENTER);
  setupSerial();
  //myPort = new Serial(this, "/dev/cu.usbmodem1411", 9600);
  //size(640, 360);
  fullScreen();
  w = width;
  h = height;
  Ch1 = new Movie(this, "IBR_BJ.mp4");
  Ch2 = new Movie(this, "IBR_EXPO.mp4");
  Ch3 = new Movie(this, "IBR_WT.mp4");
  //Ch1.play();
  //Ch2.play();
  //Ch3.play();
  Ch1.loop();
  Ch2.loop();
  Ch3.loop();
  m1 = new SoundFile(this, "doppelganger.mp3");
  m2 = new SoundFile(this, "TRACK UNO.aiff");
  m3 = new SoundFile(this, "100000.mp3");
  m1.play();
  //m2.play();
  //m3.play();
  //m1.loop();
  //m2.loop();
  //m3.loop();
  //Ch1.pause();
  //Ch2.pause();
  //Ch3.pause();
}

void mousePressed() {
  counter+=1;

  if (counter==1) {
    m1.stop();
    m2.play();
   // m2.jump(15.3);
  }
  if (counter==2) {
    m2.stop();
    m3.play();
   // m3.jump(15.3);
  }
  if (counter==3) {
    m3.stop();
    m1.play();
    counter = 0;
  }
}

void keyPressed() {
  if (key == 'w' || key == 'W') {
    Ch1.speed(4.0);
    Ch2.speed(4.0);
    Ch3.speed(4.0);
  } else if (key == 'a' || key == 'A') {
    Ch1.speed(.5);
    Ch2.speed(.5);
    Ch3.speed(.5);
  } else if (key == 's' || key == 'S') {
    Ch1.speed(2.0);
    Ch2.speed(2.0);
    Ch3.speed(2.0);
  } else if (key == 'd' || key == 'D') {
    Ch1.speed(.25);
    Ch2.speed(.25);
    Ch3.speed(.25);
  } else if (key == 'p' || key == 'P') {
    Ch1.pause();
    Ch2.pause();
    Ch3.pause();
  } else {
    Ch1.speed(1.0);
    Ch2.speed(1.0);
    Ch3.speed(1.0);
    Ch1.play();
    Ch2.play();
    Ch3.play();
  }

  if (key == 'h' || key == 'H') {
    image(helpimg, width/2, height/2, width/2, height/2);
  }

  if (key == CODED) {
    if (keyCode == UP) {
      filter(INVERT);
    } else if (keyCode == DOWN) {
      filter(THRESHOLD);
    } else if (keyCode == LEFT) {
      filter(ERODE);
    } else if (keyCode == RIGHT) {
      filter(POSTERIZE, 2);
    } else if (keyCode == RIGHT) {
      filter(POSTERIZE, 2);
    }
  }
}
void draw() {
  updateSerial();
  //printArray(sensorValues);
  // to read the value from the Arduino
  /*while ( myPort.available() > 0) {
   valueFromArduino = char(myPort.read());
   }
   if (valueFromArduino != '0') {
   println(valueFromArduino);
   }
   if (valueFromArduino == '1') {
   println(valueFromArduino);
   image(Ch1, x, y, width, height);
   }
   if (valueFromArduino == '2') {
   println(valueFromArduino);
   image(Ch2, x, y, width, height);
   }
   if (valueFromArduino == '3') {
   println(valueFromArduino);
   image(Ch3, x, y, width, height);
   }*/


  vid =sensorValues[0];
  zoom = map(sensorValues[3], 0, 255, 1, 2); 
  zoom = round(zoom*10);
  zoom = zoom/10;
  //pan = map(sensorValues[1], 0, 255, w/2-(((w*zoom)-w)/2), w/2+(((w*zoom)-w)/2));
  //tilt = map(sensorValues[2], 0, 255, h/2-(((h*zoom)-h)/2), h/2+(((h*zoom)-h)/2));
  //pan = map(sensorValues[1], 0, 255, 320-(320*zoom-320), 320*zoom-320);
  // tilt = map(sensorValues[2], 0, 255, 180-(180*zoom-180), 180*zoom-180);
  if (pan<= width*zoom-width) {
  }

  if (tilt<= height*zoom-height) {
  }
  if (zoom>1.2) {
    pan = map(sensorValues[1], 0, 255, (w/2)-((w/2)*zoom-(w/2)), (w/4)*zoom);
    tilt = map(sensorValues[2], 0, 255, (h/2)-((h/2)*zoom-(h/2)), (h/4)*zoom);
  } else {
    pan = w/2;
    tilt = h/2;
  }

  if (vid == 1) {
    //    Ch1.read();
    pushMatrix();
    //translate(width/2, height/2);
    scale(zoom);
    image(Ch1, pan, tilt, w, h);
    popMatrix();
  }

  if (vid == 2) {
    pushMatrix();
    //translate(width/2, height/2);
    scale(zoom);
    image(Ch2, pan, tilt, w, h);
    popMatrix();
  }

  if (vid == 3) {
    pushMatrix();
    //translate(width/2, height/2);
    scale(zoom);
    image(Ch3, pan, tilt, w, h);
    popMatrix();
  }

  //println("pan=", pan, "tilt=", tilt, "zoom=", zoom, "vid=", vid);
}

void setupSerial() {
  printArray(Serial.list());
  myPort = new Serial(this, "/dev/cu.usbmodem1411", 9600);
  // WARNING!
  // You will definitely get an error here.
  // Change the PORT_INDEX to 0 and try running it again.
  // And then, check the list of the ports,
  // find the port "/dev/cu.usbmodem----" or "/dev/tty.usbmodem----" 
  // and replace PORT_INDEX above with the index number of the port.

  myPort.clear();
  // Throw out the first reading,
  // in case we started reading in the middle of a string from the sender.
  myString = myPort.readStringUntil( 10 );  // 10 = 'n'  Linefeed in ASCII
  myString = null;

  sensorValues = new int[NUM_OF_VALUES];
}



void updateSerial() {
  while (myPort.available() > 0) {
    myString = myPort.readStringUntil( 10 ); // 10 = 'n'  Linefeed in ASCII
    if (myString != null) {
      println(myString);
      String[] serialInArray = split(trim(myString), ",");
      if (serialInArray.length == NUM_OF_VALUES) {
        for (int i=0; i<serialInArray.length; i++) {
          sensorValues[i] = int(serialInArray[i]);
        }
      }
    }
  }
}

// Called every time a new frame is available to read
void movieEvent(Movie m) {
  m.read();
  /*  if (m == Ch1) {
   Ch1.read();
   } else if (m == Ch2) {
   Ch2.read();
   } else if (m == Ch3) {
   Ch3.read();
   }*/
}

Final Project – Tyson Lee Upshaw

 

Into the Belly of the Beast

A game that is simply frustrating… on multiple levels

DESCRIPTION

Into the Belly of the Beast was coded and conceived in response to A-maze-ingly Frustrated’s feedback and furthermore drives itself into the realm of frustration. In order to meaningfully frustrate its users, there are many layers to Into the Belly of the Beast. Beginning with a title screen, players have to pay very close attention to the details of the description. When directions are followed correctly, Into the Belly of the Beast boasts 9 different levels that not only change directional orientation upon switching levels, but require the number key be held and the cooperative usage of every level to finish the game. If the pellet hits a barrier, the pellet must restart. Into the Belly of the Beast completes what it sets out to do by its simple use of motion sensors. Motions sensors are your input which even furthers the frustrating capabilities of the game as it is more difficult to memorize without a tangible input, and with a tangible input.

Here is what each level looks like: (Including the Title Screen)

DEMONSTRATIONS & USER TESTING (Note: The videos are near those who gave feedback, however, not all videos have people who are directly mentioned in this documentation)

Into the Belly of the Beast was very simply set up. If I could go back and add on to it, I would add some sort of digital fabrication, but for this final, I could not think of what would be suitable.

Amy was first to test Into the Belly of the Beast which happened completely randomly. I had seen her and she was more than willing to help me out a little bit. I noticed that Amy pressed the space bar to start. I hadn’t even thought about using the space bar, but it was surely a popular move. She said as it’s a game, she just expected to press space. Even though the title screen has the true way to start hidden in it, it wasn’t transparent enough to just do. Amy, also, suggested that there be some sort of hint system. She just wanted to know where to start and how to progress without getting to frustrated and quitting. She also claims this game is good because she is the type to want to start and finish, regardless of difficulty.

 

The next user was Cassie who happened to be at the table next to me at the IMA Show. Cassie suggested that maybe I speed things up a little, and also claims “I think it’s difficult enough without the directional shifts.” Which is totally understandable. I hadn’t really considered the difference between frustration and difficulty, so I definitely started taking this into consideration. (Note: This isn’t Cassie, of course!)

Next up is Nick! Nick also reached and tapped the space bar to start, so I was seeing the importance of directions. Nick also explained the attractiveness of challenging games. He reminded me that what made them appealing was the difficulty curve and suggested that I make the game progressively more difficult opposed to making it difficult and frustrating immediately.

Meizhi Ng also had her trial and actually did well (after coming back). It was very flattering to see her walk around and check out other projects, but also feel the need to come back and try again. One phrase that definitely stuck out during her trial was, “I can do this.” Hearing this was nice because it suggests the want to get better and win the game. She also confirmed it was frustrating at one point, but not another, but I’m gonna act like she just said it was frustrating, so that’s rad.

Tyler tried Into the Belly of the Beast and seemed to enjoy it. He suggested that I add some more style and told me to consider other inputs. He also attributed my game with confusing, but manageable, which totally is what I was going for.

Nimrah, who was an integral influence on my updating A-Maze-Ingly Frustrated, had a lot of suggestions and tweaks she would make, but, all-in-all seemed to be very happy with the projects concept and aesthetics. She distinctly liked the circle level (Level 6), because the wave shape made her feel freer to move. She claimed A-Maze-Ingly Frustrated was too hard to play, but thought that because there are several levels to use in Into the Belly of the Beast, the user feels freer in general to make their own decisions that impact gameplay. She also would refer to the game as a frustrating one. She likes the fact that you have to adapt and learn more about it the more you play. (Note: These two aren’t Nimrah, of course).

Kate reached for the space bar, and I knew this would be a common trend. Next time, Tyson, next time! She had a really cool suggestion though: instead of making so many levels, make it so that the game colors can invert, and when they do the player can switch its path.

Ricardo had a novel approach to playing the game. He started quickly and very successfully. One thing that helped lead to his success was his tapping the motion sensors. In doing this, he was allowing the ball to move slower so he can make more decisions that move him further. He agrees the game isn’t frustrating and appreciates not only the learning curve, but the fact the game can be seen as a social analogy. In society, regardless of diversity, we have the same expectations, just as in the game, you expect some aspects of the level to remain constant when they are all different. He does, however, suggest I add an incentive, or there is no true reason to trying to win the game.

Professor Rudi really seemed to enjoy the concept of the game and suggest that I change the name to the Anti-Game due to the absence of explicit directives and the necessity of someone to explain if you’re not thinking creatively.

Amy DeCillis also enjoyed the game claiming it was cool and something she’d definitely want to come back and play.

Mostafa was the first person I did not explain a single thing to. He is in my class, so he had an idea of what to expect, but not to what extent. He asked questions and I answered them, but for the most part, he adapted to the game play and it was so cool seeing the result. He did the same thing Ricardo did, but tapped the number keys instead. He suggests that I make it very apparent what I want the user to accomplish and that I mark this on the title screen. He compared this to the safe dial maze, which requires a notebook and notes to finish.

CONCEPTUAL DEVELOPMENT

IDEATION

Just like A-maze-ingly Frustrated, WarioWare D.I.Y played a big role in inspiration and conceptualization. Just as a reminder, to make sure you know what I mean, take these for example:

https://www.youtube.com/watch?v=_3VRTgMWVsc

As soon as I saw this, I was inspired to create something that was frustrating just enough, users wanted to continue to use it.

In order to get it from A-maze-ingly Frustrated to Into the Belly of the Beast, I demolished and scratched an entirely different project, “Go Bananas.”

Go Bananas was similar in some sense, as it was a maze game, but it had more story to it, and multiple levels that help the user feel a continuity with the game. The biggest issue I had with following through with this game was its complexity of coding. As a college student, of course, we look for the easy way out, but Into the Belly of the Beast was not nearly as easy as I was looking for it to be. In the future, I’d like to see what I can do with Go Bananas, but until then, here was some of my plan.

In order to get to Into the Belly of the Beast was simple. Downloading a Pacman app and feeling bad for those that fell victim. I immediately saw the maze and was like, OH YEAH! I began thinking of other simple games.

I completely free handed this code.


RESEARCH

Because this essentially was an extension of my midterm, the research side of this final was mainly an extension also. I used classes a lot more this time to truly make sure individual pieces of code were organized and it helped with making separate barriers and to keep the player in the same place on every level.

Strings were an integral part of this code, however, I don’t think I still completely understand how to use them. I got ‘em in there though!  

I also used my midterm feedback to update, which is a type of research I’d say.

DESIGN

I wanted the design of the levels to feature the ghosts in Pacman, so I purposefully colored the first 4 levels as Pinky, Inky, Blinky and Clyde.

Image result for inky blinky pinky clyde pacman

Other than that, I thought patterns would be aesthetically pleasing and wanted variation for sure.

Just like my midterm, I particularly spent long hours on this project. In these long hours juxtaposed to my midterm hours, I learned even more. The biggest learning points, again, is that Processing is here to help me, not hurt me and I could have very well minimized the almost 2,500 lines of code for the game. I also learned the possibilities with processing, arduino and my own potential. After seeing so many awesome projects, it was awesome to see what a semester of an IMA class can teach you. I’m excited to see where I can go from here!

https://docs.google.com/presentation/d/1w00SySyWxKvCQRrEUCgRJ3r9SyIgG3yJOGK3nO4Isg4/edit#slide=id.g39d85ec55e_0_86

import processing.serial.*;

PFont font1;
PFont font2;

int NUM_OF_VALUES = 4; 
int[] sensorValues; 
String myString = null;
Serial myPort;

ball1 player1;

Barrier1[] Barrier1;
Barrier2[] Barrier2;
Barrier3[] Barrier3;
Barrier4[] Barrier4;
Barrier5[] Barrier5;
Barrier6[] Barrier6;
Barrier7[] Barrier7;
Barrier8[] Barrier8;
Barrier9[] Barrier9;

void setup()
{
  size (1350, 750);

  titleScreen();

  frameRate (40);

  setupSerial();

  player1 = new ball1 (50, 50);

  ///Maze 1///

  Barrier1 = new Barrier1 [193];
  Barrier1 [0] = new Barrier1 (0, 0, 90, 30);
  Barrier1 [1] = new Barrier1 (0, 0, 30, 90);
  Barrier1 [2] = new Barrier1 (60, 0, 30, 750);
  Barrier1 [3] = new Barrier1 (0, 60, 90, 30);
  Barrier1 [4] = new Barrier1 (60, 0, 180, 30);
  Barrier1 [5] = new Barrier1 (60, 60, 180, 30);
  Barrier1 [6] = new Barrier1 (240, 0, 30, 180);
  Barrier1 [7] = new Barrier1 (240, 0, 90, 30);
  Barrier1 [8] = new Barrier1 (300, 0, 30, 180);
  Barrier1 [9] = new Barrier1 (240, 150, 90, 30);
  Barrier1 [10] = new Barrier1 (60, 60, 180, 30);
  Barrier1 [11] = new Barrier1 (60, 120, 180, 30);
  Barrier1 [12] = new Barrier1 (240, 150, 30, 180);
  Barrier1 [13] = new Barrier1 (240, 150, 90, 30);
  Barrier1 [14] = new Barrier1 (300, 150, 30, 180);
  Barrier1 [15] = new Barrier1 (240, 300, 90, 30);
  Barrier1 [16] = new Barrier1 (60, 120, 180, 30);
  Barrier1 [17] = new Barrier1 (60, 180, 180, 30);
  Barrier1 [18] = new Barrier1 (240, 300, 30, 180);
  Barrier1 [19] = new Barrier1 (240, 300, 90, 30);
  Barrier1 [20] = new Barrier1 (300, 300, 30, 180);
  Barrier1 [21] = new Barrier1 (240, 450, 90, 30);
  Barrier1 [22] = new Barrier1 (60, 180, 180, 30);
  Barrier1 [23] = new Barrier1 (60, 240, 180, 30);
  Barrier1 [24] = new Barrier1 (240, 450, 30, 180);
  Barrier1 [25] = new Barrier1 (240, 450, 90, 30);
  Barrier1 [26] = new Barrier1 (300, 450, 30, 180);
  Barrier1 [27] = new Barrier1 (240, 600, 90, 30);
  Barrier1 [28] = new Barrier1 (60, 240, 180, 30);
  Barrier1 [29] = new Barrier1 (60, 300, 180, 30);
  Barrier1 [30] = new Barrier1 (240, 600, 30, 180);
  Barrier1 [31] = new Barrier1 (240, 600, 90, 30);
  Barrier1 [32] = new Barrier1 (300, 600, 30, 180);
  Barrier1 [33] = new Barrier1 (240, 750, 90, 30);
  Barrier1 [34] = new Barrier1 (60, 300, 180, 30);
  Barrier1 [35] = new Barrier1 (60, 360, 180, 30);
  Barrier1 [36] = new Barrier1 (60, 360, 180, 30);
  Barrier1 [37] = new Barrier1 (60, 420, 180, 30);
  Barrier1 [38] = new Barrier1 (60, 420, 180, 30);
  Barrier1 [39] = new Barrier1 (60, 480, 180, 30);
  Barrier1 [40] = new Barrier1 (60, 540, 180, 30);
  Barrier1 [41] = new Barrier1 (60, 600, 180, 30);
  Barrier1 [42] = new Barrier1 (60, 600, 180, 30);
  Barrier1 [43] = new Barrier1 (60, 660, 180, 30);
  Barrier1 [44] = new Barrier1 (60, 660, 180, 30);
  Barrier1 [45] = new Barrier1 (60, 720, 180, 30);
  Barrier1 [46] = new Barrier1 (0, 60, 30, 180);
  Barrier1 [47] = new Barrier1 (0, 60, 90, 30);
  Barrier1 [48] = new Barrier1 (0, 60, 30, 180);
  Barrier1 [49] = new Barrier1 (0, 210, 90, 30);
  Barrier1 [50] = new Barrier1 (0, 210, 30, 180);
  Barrier1 [51] = new Barrier1 (0, 210, 90, 30);
  Barrier1 [52] = new Barrier1 (0, 210, 30, 180);
  Barrier1 [53] = new Barrier1 (0, 360, 90, 30);
  Barrier1 [54] = new Barrier1 (0, 360, 30, 180);
  Barrier1 [55] = new Barrier1 (0, 360, 90, 30);
  Barrier1 [56] = new Barrier1 (0, 360, 30, 180);
  Barrier1 [57] = new Barrier1 (0, 510, 90, 30);
  Barrier1 [58] = new Barrier1 (0, 510, 30, 180);
  Barrier1 [59] = new Barrier1 (0, 510, 90, 30);
  Barrier1 [60] = new Barrier1 (0, 510, 30, 180);
  Barrier1 [61] = new Barrier1 (0, 670, 90, 30);
  Barrier1 [62] = new Barrier1 (0, 670, 30, 180);
  Barrier1 [63] = new Barrier1 (0, 670, 90, 30);
  Barrier1 [64] = new Barrier1 (0, 670, 30, 180);
  Barrier1 [65] = new Barrier1 (0, 830, 90, 30);
  Barrier1 [66] = new Barrier1 (300, 330, 180, 30);
  Barrier1 [67] = new Barrier1 (300, 390, 180, 30);
  Barrier1 [68] = new Barrier1 (300, 390, 180, 30);
  Barrier1 [69] = new Barrier1 (300, 450, 180, 30);
  Barrier1 [70] = new Barrier1 (300, 510, 180, 30);
  Barrier1 [71] = new Barrier1 (300, 570, 180, 30);
  Barrier1 [72] = new Barrier1 (300, 570, 180, 30);
  Barrier1 [73] = new Barrier1 (300, 630, 180, 30);
  Barrier1 [74] = new Barrier1 (300, 630, 180, 30);
  Barrier1 [75] = new Barrier1 (300, 690, 180, 30);
  Barrier1 [76] = new Barrier1 (300, 270, 180, 30);
  Barrier1 [77] = new Barrier1 (300, 330, 180, 30);
  Barrier1 [78] = new Barrier1 (300, 210, 180, 30);
  Barrier1 [79] = new Barrier1 (300, 270, 180, 30);
  Barrier1 [80] = new Barrier1 (300, 150, 180, 30);
  Barrier1 [81] = new Barrier1 (300, 210, 180, 30);
  Barrier1 [82] = new Barrier1 (300, 90, 180, 30);
  Barrier1 [83] = new Barrier1 (300, 150, 180, 30);
  Barrier1 [84] = new Barrier1 (300, 30, 180, 30);
  Barrier1 [85] = new Barrier1 (300, 90, 180, 30);
  Barrier1 [86] = new Barrier1 (480, 30, 30, 180);
  Barrier1 [87] = new Barrier1 (480, 30, 90, 30);
  Barrier1 [88] = new Barrier1 (540, 30, 30, 180);
  Barrier1 [89] = new Barrier1 (480, 180, 90, 30);
  Barrier1 [90] = new Barrier1 (480, 180, 30, 180);
  Barrier1 [91] = new Barrier1 (480, 180, 90, 30);
  Barrier1 [92] = new Barrier1 (540, 180, 30, 180);
  Barrier1 [93] = new Barrier1 (480, 330, 90, 30);
  Barrier1 [94] = new Barrier1 (480, 330, 30, 180);
  Barrier1 [95] = new Barrier1 (480, 330, 90, 30);
  Barrier1 [96] = new Barrier1 (540, 330, 30, 180);
  Barrier1 [97] = new Barrier1 (480, 480, 90, 30);
  Barrier1 [98] = new Barrier1 (480, 480, 30, 180);
  Barrier1 [99] = new Barrier1 (480, 480, 90, 30);
  Barrier1 [100] = new Barrier1 (540, 480, 30, 180);
  Barrier1 [101] = new Barrier1 (480, 640, 90, 30);
  Barrier1 [102] = new Barrier1 (480, 640, 30, 180);
  Barrier1 [103] = new Barrier1 (480, 640, 90, 30);
  Barrier1 [104] = new Barrier1 (540, 640, 30, 180);
  Barrier1 [105] = new Barrier1 (480, 800, 90, 30);
  Barrier1 [106] = new Barrier1 (600, 0, 30, 750);
  Barrier1 [107] = new Barrier1 (660, 0, 30, 750);
  Barrier1 [108] = new Barrier1 (720, 30, 30, 180);
  Barrier1 [109] = new Barrier1 (720, 30, 90, 30);
  Barrier1 [110] = new Barrier1 (780, 30, 30, 180);
  Barrier1 [111] = new Barrier1 (720, 180, 90, 30);
  Barrier1 [112] = new Barrier1 (720, 180, 30, 180);
  Barrier1 [113] = new Barrier1 (720, 180, 90, 30);
  Barrier1 [114] = new Barrier1 (780, 180, 30, 180);
  Barrier1 [115] = new Barrier1 (720, 330, 90, 30);
  Barrier1 [116] = new Barrier1 (720, 330, 30, 180);
  Barrier1 [117] = new Barrier1 (720, 330, 90, 30);
  Barrier1 [118] = new Barrier1 (780, 330, 30, 180);
  Barrier1 [119] = new Barrier1 (720, 480, 90, 30);
  Barrier1 [120] = new Barrier1 (720, 480, 30, 180);
  Barrier1 [121] = new Barrier1 (720, 480, 90, 30);
  Barrier1 [122] = new Barrier1 (780, 480, 30, 180);
  Barrier1 [123] = new Barrier1 (720, 640, 90, 30);
  Barrier1 [124] = new Barrier1 (720, 640, 30, 180);
  Barrier1 [125] = new Barrier1 (720, 640, 90, 30);
  Barrier1 [126] = new Barrier1 (780, 640, 30, 180);
  Barrier1 [127] = new Barrier1 (720, 800, 90, 30);
  Barrier1 [128] = new Barrier1 (780, 330, 180, 30);
  Barrier1 [129] = new Barrier1 (780, 390, 180, 30);
  Barrier1 [130] = new Barrier1 (780, 390, 180, 30);
  Barrier1 [131] = new Barrier1 (780, 450, 180, 30);
  Barrier1 [132] = new Barrier1 (780, 510, 180, 30);
  Barrier1 [133] = new Barrier1 (780, 570, 180, 30);
  Barrier1 [134] = new Barrier1 (780, 570, 180, 30);
  Barrier1 [135] = new Barrier1 (780, 630, 180, 30);
  Barrier1 [136] = new Barrier1 (780, 630, 180, 30);
  Barrier1 [137] = new Barrier1 (780, 690, 180, 30);
  Barrier1 [138] = new Barrier1 (780, 270, 180, 30);
  Barrier1 [139] = new Barrier1 (780, 330, 180, 30);
  Barrier1 [140] = new Barrier1 (780, 210, 180, 30);
  Barrier1 [141] = new Barrier1 (780, 270, 180, 30);
  Barrier1 [142] = new Barrier1 (780, 150, 180, 30);
  Barrier1 [143] = new Barrier1 (780, 210, 180, 30);
  Barrier1 [144] = new Barrier1 (780, 90, 180, 30);
  Barrier1 [145] = new Barrier1 (780, 150, 180, 30);
  Barrier1 [146] = new Barrier1 (780, 30, 180, 30);
  Barrier1 [147] = new Barrier1 (780, 90, 180, 30);
  Barrier1 [148] = new Barrier1 (960, 0, 30, 180);
  Barrier1 [149] = new Barrier1 (960, 0, 90, 30);
  Barrier1 [150] = new Barrier1 (1020, 0, 30, 180);
  Barrier1 [151] = new Barrier1 (960, 150, 90, 30);
  Barrier1 [152] = new Barrier1 (960, 150, 30, 180);
  Barrier1 [153] = new Barrier1 (960, 150, 90, 30);
  Barrier1 [154] = new Barrier1 (1020, 150, 30, 180);
  Barrier1 [155] = new Barrier1 (960, 300, 90, 30);
  Barrier1 [156] = new Barrier1 (960, 300, 30, 180);
  Barrier1 [157] = new Barrier1 (960, 300, 90, 30);
  Barrier1 [158] = new Barrier1 (1020, 300, 30, 180);
  Barrier1 [159] = new Barrier1 (960, 450, 90, 30);
  Barrier1 [160] = new Barrier1 (960, 450, 30, 180);
  Barrier1 [161] = new Barrier1 (960, 450, 90, 30);
  Barrier1 [162] = new Barrier1 (1020, 450, 30, 180);
  Barrier1 [163] = new Barrier1 (960, 600, 90, 30);
  Barrier1 [164] = new Barrier1 (960, 600, 30, 180);
  Barrier1 [165] = new Barrier1 (960, 600, 90, 30);
  Barrier1 [166] = new Barrier1 (1020, 600, 30, 180);
  Barrier1 [167] = new Barrier1 (960, 750, 90, 30);
  Barrier1 [168] = new Barrier1 (1020, 240, 180, 30);
  Barrier1 [169] = new Barrier1 (1020, 300, 180, 30);
  Barrier1 [170] = new Barrier1 (1020, 180, 180, 30);
  Barrier1 [171] = new Barrier1 (1020, 240, 180, 30);
  Barrier1 [172] = new Barrier1 (1020, 120, 180, 30);
  Barrier1 [173] = new Barrier1 (1020, 180, 180, 30);
  Barrier1 [174] = new Barrier1 (1020, 60, 180, 30);
  Barrier1 [175] = new Barrier1 (1020, 120, 180, 30);
  Barrier1 [176] = new Barrier1 (1020, 600, 180, 30);
  Barrier1 [177] = new Barrier1 (1020, 660, 180, 30);
  Barrier1 [178] = new Barrier1 (1020, 540, 180, 30);
  Barrier1 [179] = new Barrier1 (1020, 600, 180, 30);
  Barrier1 [180] = new Barrier1 (1020, 480, 180, 30);
  Barrier1 [181] = new Barrier1 (1020, 540, 180, 30);
  Barrier1 [182] = new Barrier1 (1020, 420, 180, 30);
  Barrier1 [183] = new Barrier1 (1020, 480, 180, 30);
  Barrier1 [184] = new Barrier1 (1020, 360, 180, 30);
  Barrier1 [185] = new Barrier1 (1020, 420, 180, 30);
  Barrier1 [186] = new Barrier1 (1020, 0, 180, 30);
  Barrier1 [187] = new Barrier1 (1020, 60, 180, 30);
  Barrier1 [188] = new Barrier1 (1020, 660, 180, 30);
  Barrier1 [189] = new Barrier1 (1020, 720, 180, 30);
  Barrier1 [190] = new Barrier1 (1240, 0, 90, 750);
  Barrier1 [191] = new Barrier1 (1180, 0, 90, 750);
  Barrier1 [192] = new Barrier1 (1300, 0, 90, 750);

  ///Maze 2///

  Barrier2 = new Barrier2 [304];
  Barrier2 [0] = new Barrier2 (0, 0, 90, 30);
  Barrier2 [1] = new Barrier2 (0, 0, 30, 90);
  Barrier2 [2] = new Barrier2 (60, 0, 30, 90);
  Barrier2 [3] = new Barrier2 (0, 60, 90, 30);
  Barrier2 [4] = new Barrier2 (480, 270, 150, 30);
  Barrier2 [5] = new Barrier2 (480, 120, 30, 150);
  Barrier2 [6] = new Barrier2 (480, 120, 90, 30);
  Barrier2 [7] = new Barrier2 (540, 120, 30, 120); 
  Barrier2 [8] = new Barrier2 (540, 150, 150, 30);
  Barrier2 [9] = new Barrier2 (600, 210, 30, 90);
  Barrier2 [10] = new Barrier2 (600, 240, 150, 30);
  Barrier2 [11] = new Barrier2 (660, 150, 30, 60);
  Barrier2 [12] = new Barrier2 (660, 180, 60, 30);
  Barrier2 [13] = new Barrier2 (720, 180, 30, 90);
  Barrier2 [14] = new Barrier2 (240, 270, 150, 30);
  Barrier2 [15] = new Barrier2 (240, 120, 30, 150);
  Barrier2 [16] = new Barrier2 (240, 120, 90, 30);
  Barrier2 [17] = new Barrier2 (300, 120, 30, 120); 
  Barrier2 [18] = new Barrier2 (300, 150, 150, 30);
  Barrier2 [19] = new Barrier2 (360, 210, 30, 90);
  Barrier2 [20] = new Barrier2 (360, 240, 150, 30);
  Barrier2 [21] = new Barrier2 (420, 150, 30, 60);
  Barrier2 [22] = new Barrier2 (420, 180, 60, 30);
  Barrier2 [23] = new Barrier2 (480, 180, 30, 90);
  Barrier2 [24] = new Barrier2 (0, 270, 150, 30);
  Barrier2 [25] = new Barrier2 (0, 120, 30, 150);
  Barrier2 [26] = new Barrier2 (0, 120, 90, 30);
  Barrier2 [27] = new Barrier2 (60, 120, 30, 120); 
  Barrier2 [28] = new Barrier2 (60, 150, 150, 30);
  Barrier2 [29] = new Barrier2 (120, 210, 30, 90);
  Barrier2 [30] = new Barrier2 (120, 240, 150, 30);
  Barrier2 [31] = new Barrier2 (180, 150, 30, 60);
  Barrier2 [32] = new Barrier2 (180, 180, 60, 30);
  Barrier2 [33] = new Barrier2 (240, 180, 30, 90);
  Barrier2 [34] = new Barrier2 (720, 270, 150, 30);
  Barrier2 [35] = new Barrier2 (720, 120, 30, 150);
  Barrier2 [36] = new Barrier2 (720, 120, 90, 30);
  Barrier2 [37] = new Barrier2 (780, 120, 30, 120); 
  Barrier2 [38] = new Barrier2 (780, 150, 150, 30);
  Barrier2 [39] = new Barrier2 (840, 210, 30, 90);
  Barrier2 [40] = new Barrier2 (840, 240, 150, 30);
  Barrier2 [41] = new Barrier2 (900, 150, 30, 60);
  Barrier2 [42] = new Barrier2 (900, 180, 60, 30);
  Barrier2 [43] = new Barrier2 (960, 180, 30, 90);
  Barrier2 [44] = new Barrier2 (960, 270, 150, 30);
  Barrier2 [45] = new Barrier2 (960, 120, 30, 150);
  Barrier2 [46] = new Barrier2 (960, 120, 90, 30);
  Barrier2 [47] = new Barrier2 (1020, 120, 30, 120); 
  Barrier2 [48] = new Barrier2 (1020, 150, 150, 30);
  Barrier2 [49] = new Barrier2 (1080, 210, 30, 90);
  Barrier2 [50] = new Barrier2 (1080, 240, 150, 30);
  Barrier2 [51] = new Barrier2 (1140, 150, 30, 60);
  Barrier2 [52] = new Barrier2 (1140, 180, 60, 30);
  Barrier2 [53] = new Barrier2 (1200, 180, 30, 90);
  Barrier2 [54] = new Barrier2 (1200, 270, 150, 30);
  Barrier2 [55] = new Barrier2 (1200, 120, 30, 150);
  Barrier2 [56] = new Barrier2 (1200, 120, 90, 30);
  Barrier2 [57] = new Barrier2 (1260, 120, 30, 120); 
  Barrier2 [58] = new Barrier2 (1260, 150, 150, 30);
  Barrier2 [59] = new Barrier2 (1320, 210, 30, 90);
  Barrier2 [60] = new Barrier2 (1320, 240, 150, 30);
  Barrier2 [61] = new Barrier2 (1380, 150, 30, 60);
  Barrier2 [62] = new Barrier2 (1380, 180, 60, 30);
  Barrier2 [63] = new Barrier2 (1440, 180, 30, 90);
  Barrier2 [64] = new Barrier2 (480, 450, 150, 30);
  Barrier2 [65] = new Barrier2 (480, 300, 30, 150);
  Barrier2 [66] = new Barrier2 (480, 300, 90, 30);
  Barrier2 [67] = new Barrier2 (540, 300, 30, 120); 
  Barrier2 [68] = new Barrier2 (540, 330, 150, 30);
  Barrier2 [69] = new Barrier2 (600, 390, 30, 90);
  Barrier2 [70] = new Barrier2 (600, 420, 150, 30);
  Barrier2 [71] = new Barrier2 (660, 330, 30, 60);
  Barrier2 [72] = new Barrier2 (660, 360, 60, 30);
  Barrier2 [73] = new Barrier2 (720, 360, 30, 90);
  Barrier2 [74] = new Barrier2 (240, 450, 150, 30);
  Barrier2 [75] = new Barrier2 (240, 300, 30, 150);
  Barrier2 [76] = new Barrier2 (240, 300, 90, 30);
  Barrier2 [77] = new Barrier2 (300, 300, 30, 120); 
  Barrier2 [78] = new Barrier2 (300, 330, 150, 30);
  Barrier2 [79] = new Barrier2 (360, 390, 30, 90);
  Barrier2 [80] = new Barrier2 (360, 420, 150, 30);
  Barrier2 [81] = new Barrier2 (420, 330, 30, 60);
  Barrier2 [82] = new Barrier2 (420, 360, 60, 30);
  Barrier2 [83] = new Barrier2 (480, 360, 30, 90);
  Barrier2 [84] = new Barrier2 (0, 450, 150, 30);
  Barrier2 [85] = new Barrier2 (0, 300, 30, 150);
  Barrier2 [86] = new Barrier2 (0, 300, 90, 30);
  Barrier2 [87] = new Barrier2 (60, 300, 30, 120); 
  Barrier2 [88] = new Barrier2 (60, 330, 150, 30);
  Barrier2 [89] = new Barrier2 (120, 390, 30, 90);
  Barrier2 [90] = new Barrier2 (120, 420, 150, 30);
  Barrier2 [91] = new Barrier2 (180, 330, 30, 60);
  Barrier2 [92] = new Barrier2 (180, 360, 60, 30);
  Barrier2 [93] = new Barrier2 (240, 360, 30, 90);
  Barrier2 [94] = new Barrier2 (720, 450, 150, 30);
  Barrier2 [95] = new Barrier2 (720, 300, 30, 150);
  Barrier2 [96] = new Barrier2 (720, 300, 90, 30);
  Barrier2 [97] = new Barrier2 (780, 300, 30, 120); 
  Barrier2 [98] = new Barrier2 (780, 330, 150, 30);
  Barrier2 [99] = new Barrier2 (840, 390, 30, 90);
  Barrier2 [100] = new Barrier2 (840, 420, 150, 30);
  Barrier2 [101] = new Barrier2 (900, 330, 30, 60);
  Barrier2 [102] = new Barrier2 (900, 360, 60, 30);
  Barrier2 [103] = new Barrier2 (960, 360, 30, 90);
  Barrier2 [104] = new Barrier2 (960, 450, 150, 30);
  Barrier2 [105] = new Barrier2 (960, 300, 30, 150);
  Barrier2 [106] = new Barrier2 (960, 300, 90, 30);
  Barrier2 [107] = new Barrier2 (1020, 300, 30, 120);
  Barrier2 [108] = new Barrier2 (1020, 330, 150, 30);
  Barrier2 [109] = new Barrier2 (1080, 390, 30, 90);
  Barrier2 [110] = new Barrier2 (1080, 420, 150, 30);
  Barrier2 [111] = new Barrier2 (1140, 330, 30, 60);
  Barrier2 [112] = new Barrier2 (1140, 360, 60, 30);
  Barrier2 [113] = new Barrier2 (1200, 360, 30, 90);
  Barrier2 [114] = new Barrier2 (1200, 450, 150, 30);
  Barrier2 [115] = new Barrier2 (1200, 300, 30, 150);
  Barrier2 [116] = new Barrier2 (1200, 300, 90, 30);
  Barrier2 [117] = new Barrier2 (1260, 300, 30, 120);
  Barrier2 [118] = new Barrier2 (1260, 330, 150, 30);
  Barrier2 [119] = new Barrier2 (1320, 390, 30, 90);
  Barrier2 [120] = new Barrier2 (1320, 420, 150, 30);
  Barrier2 [121] = new Barrier2 (1380, 330, 30, 60);
  Barrier2 [122] = new Barrier2 (1380, 360, 60, 30);
  Barrier2 [123] = new Barrier2 (1440, 360, 30, 90);
  Barrier2 [124] = new Barrier2 (480, 630, 150, 30);
  Barrier2 [125] = new Barrier2 (480, 480, 30, 150);
  Barrier2 [126] = new Barrier2 (480, 480, 90, 30);
  Barrier2 [127] = new Barrier2 (540, 480, 30, 120); 
  Barrier2 [128] = new Barrier2 (540, 510, 150, 30);
  Barrier2 [129] = new Barrier2 (600, 570, 30, 90);
  Barrier2 [130] = new Barrier2 (600, 600, 150, 30);
  Barrier2 [131] = new Barrier2 (660, 510, 30, 60);
  Barrier2 [132] = new Barrier2 (660, 540, 60, 30);
  Barrier2 [133] = new Barrier2 (720, 540, 30, 90);
  Barrier2 [134] = new Barrier2 (240, 630, 150, 30);
  Barrier2 [135] = new Barrier2 (240, 480, 30, 150);
  Barrier2 [136] = new Barrier2 (240, 480, 90, 30);
  Barrier2 [137] = new Barrier2 (300, 480, 30, 120); 
  Barrier2 [138] = new Barrier2 (300, 510, 150, 30);
  Barrier2 [139] = new Barrier2 (360, 570, 30, 90);
  Barrier2 [140] = new Barrier2 (360, 600, 150, 30);
  Barrier2 [141] = new Barrier2 (420, 510, 30, 60);
  Barrier2 [142] = new Barrier2 (420, 540, 60, 30);
  Barrier2 [143] = new Barrier2 (480, 540, 30, 90);
  Barrier2 [144] = new Barrier2 (0, 630, 150, 30);
  Barrier2 [145] = new Barrier2 (0, 480, 30, 150);
  Barrier2 [146] = new Barrier2 (0, 480, 90, 30);
  Barrier2 [147] = new Barrier2 (60, 480, 30, 120); 
  Barrier2 [148] = new Barrier2 (60, 510, 150, 30);
  Barrier2 [149] = new Barrier2 (120, 570, 30, 90);
  Barrier2 [150] = new Barrier2 (120, 600, 150, 30);
  Barrier2 [151] = new Barrier2 (180, 510, 30, 60);
  Barrier2 [152] = new Barrier2 (180, 540, 60, 30);
  Barrier2 [153] = new Barrier2 (240, 540, 30, 90);
  Barrier2 [154] = new Barrier2 (720, 630, 150, 30);
  Barrier2 [155] = new Barrier2 (720, 480, 30, 150);
  Barrier2 [156] = new Barrier2 (720, 480, 90, 30);
  Barrier2 [157] = new Barrier2 (780, 480, 30, 120); 
  Barrier2 [158] = new Barrier2 (780, 510, 150, 30);
  Barrier2 [159] = new Barrier2 (840, 570, 30, 90);
  Barrier2 [160] = new Barrier2 (840, 600, 150, 30);
  Barrier2 [161] = new Barrier2 (900, 510, 30, 60);
  Barrier2 [162] = new Barrier2 (900, 540, 60, 30);
  Barrier2 [163] = new Barrier2 (960, 540, 30, 90);
  Barrier2 [164] = new Barrier2 (960, 630, 150, 30);
  Barrier2 [165] = new Barrier2 (960, 480, 30, 150);
  Barrier2 [166] = new Barrier2 (960, 480, 90, 30);
  Barrier2 [167] = new Barrier2 (1020, 480, 30, 120);
  Barrier2 [168] = new Barrier2 (1020, 510, 150, 30);
  Barrier2 [169] = new Barrier2 (1080, 570, 30, 90);
  Barrier2 [170] = new Barrier2 (1080, 600, 150, 30);
  Barrier2 [171] = new Barrier2 (1140, 510, 30, 60);
  Barrier2 [172] = new Barrier2 (1140, 540, 60, 30);
  Barrier2 [173] = new Barrier2 (1200, 540, 30, 90);
  Barrier2 [174] = new Barrier2 (1200, 630, 150, 30);
  Barrier2 [175] = new Barrier2 (1200, 480, 30, 150);
  Barrier2 [176] = new Barrier2 (1200, 480, 90, 30);
  Barrier2 [177] = new Barrier2 (1260, 480, 30, 120);
  Barrier2 [178] = new Barrier2 (1260, 510, 150, 30);
  Barrier2 [179] = new Barrier2 (1320, 570, 30, 90);
  Barrier2 [180] = new Barrier2 (1320, 600, 150, 30);
  Barrier2 [181] = new Barrier2 (1380, 510, 30, 60);
  Barrier2 [182] = new Barrier2 (1380, 540, 60, 30);
  Barrier2 [183] = new Barrier2 (1440, 540, 30, 90);
  Barrier2 [184] = new Barrier2 (480, 810, 150, 30);
  Barrier2 [185] = new Barrier2 (480, 660, 30, 150);
  Barrier2 [186] = new Barrier2 (480, 660, 90, 30);
  Barrier2 [187] = new Barrier2 (540, 660, 30, 120); 
  Barrier2 [188] = new Barrier2 (540, 690, 150, 30);
  Barrier2 [189] = new Barrier2 (600, 750, 30, 90);
  Barrier2 [190] = new Barrier2 (600, 780, 150, 30);
  Barrier2 [191] = new Barrier2 (660, 690, 30, 60);
  Barrier2 [192] = new Barrier2 (660, 720, 60, 30);
  Barrier2 [193] = new Barrier2 (720, 720, 30, 90);
  Barrier2 [194] = new Barrier2 (240, 810, 150, 30);
  Barrier2 [195] = new Barrier2 (240, 660, 30, 150);
  Barrier2 [196] = new Barrier2 (240, 660, 90, 30);
  Barrier2 [197] = new Barrier2 (300, 660, 30, 120); 
  Barrier2 [198] = new Barrier2 (300, 690, 150, 30);
  Barrier2 [199] = new Barrier2 (360, 750, 30, 90);
  Barrier2 [200] = new Barrier2 (360, 780, 150, 30);
  Barrier2 [201] = new Barrier2 (420, 690, 30, 60);
  Barrier2 [202] = new Barrier2 (420, 720, 60, 30);
  Barrier2 [203] = new Barrier2 (480, 720, 30, 90);
  Barrier2 [204] = new Barrier2 (0, 810, 150, 30);
  Barrier2 [205] = new Barrier2 (0, 660, 30, 150);
  Barrier2 [206] = new Barrier2 (0, 660, 90, 30);
  Barrier2 [207] = new Barrier2 (60, 660, 30, 120);
  Barrier2 [208] = new Barrier2 (60, 690, 150, 30);
  Barrier2 [209] = new Barrier2 (120, 750, 30, 90);
  Barrier2 [210] = new Barrier2 (120, 780, 150, 30);
  Barrier2 [211] = new Barrier2 (180, 690, 30, 60);
  Barrier2 [212] = new Barrier2 (180, 720, 60, 30);
  Barrier2 [213] = new Barrier2 (240, 720, 30, 90);
  Barrier2 [214] = new Barrier2 (720, 810, 150, 30);
  Barrier2 [215] = new Barrier2 (720, 660, 30, 150);
  Barrier2 [216] = new Barrier2 (720, 660, 90, 30);
  Barrier2 [217] = new Barrier2 (780, 660, 30, 120); 
  Barrier2 [218] = new Barrier2 (780, 690, 150, 30);
  Barrier2 [219] = new Barrier2 (840, 750, 30, 90);
  Barrier2 [220] = new Barrier2 (840, 780, 150, 30);
  Barrier2 [221] = new Barrier2 (900, 690, 30, 60);
  Barrier2 [222] = new Barrier2 (900, 720, 60, 30);
  Barrier2 [223] = new Barrier2 (960, 720, 30, 90);
  Barrier2 [224] = new Barrier2 (960, 810, 150, 30);
  Barrier2 [225] = new Barrier2 (960, 660, 30, 150);
  Barrier2 [226] = new Barrier2 (960, 660, 90, 30);
  Barrier2 [227] = new Barrier2 (1020, 660, 30, 120);
  Barrier2 [228] = new Barrier2 (1020, 690, 150, 30);
  Barrier2 [229] = new Barrier2 (1080, 750, 30, 90);
  Barrier2 [230] = new Barrier2 (1080, 780, 150, 30);
  Barrier2 [231] = new Barrier2 (1140, 690, 30, 60);
  Barrier2 [232] = new Barrier2 (1140, 720, 60, 30);
  Barrier2 [233] = new Barrier2 (1200, 720, 30, 90);
  Barrier2 [234] = new Barrier2 (1200, 810, 150, 30);
  Barrier2 [235] = new Barrier2 (1200, 660, 30, 150);
  Barrier2 [236] = new Barrier2 (1200, 660, 90, 30);
  Barrier2 [237] = new Barrier2 (1260, 660, 30, 120);
  Barrier2 [238] = new Barrier2 (1260, 690, 150, 30);
  Barrier2 [239] = new Barrier2 (1320, 750, 30, 90);
  Barrier2 [240] = new Barrier2 (1320, 780, 150, 30);
  Barrier2 [241] = new Barrier2 (1380, 690, 30, 60);
  Barrier2 [242] = new Barrier2 (1380, 720, 60, 30);
  Barrier2 [243] = new Barrier2 (1440, 720, 30, 90);
  Barrier2 [244] = new Barrier2 (480, 90, 150, 30);
  Barrier2 [245] = new Barrier2 (480, -60, 30, 150);
  Barrier2 [246] = new Barrier2 (480, -60, 90, 30);
  Barrier2 [247] = new Barrier2 (540, -60, 30, 120); 
  Barrier2 [248] = new Barrier2 (540, -30, 150, 30);
  Barrier2 [249] = new Barrier2 (600, 30, 30, 90);
  Barrier2 [250] = new Barrier2 (600, 60, 150, 30);
  Barrier2 [251] = new Barrier2 (660, -30, 30, 60);
  Barrier2 [252] = new Barrier2 (660, 0, 60, 30);
  Barrier2 [253] = new Barrier2 (720, 0, 30, 90);
  Barrier2 [254] = new Barrier2 (240, 90, 150, 30);
  Barrier2 [255] = new Barrier2 (240, -60, 30, 150);
  Barrier2 [256] = new Barrier2 (240, -60, 90, 30);
  Barrier2 [257] = new Barrier2 (300, -60, 30, 120); 
  Barrier2 [258] = new Barrier2 (300, -30, 150, 30);
  Barrier2 [259] = new Barrier2 (360, 30, 30, 90);
  Barrier2 [260] = new Barrier2 (360, 60, 150, 30);
  Barrier2 [261] = new Barrier2 (420, -30, 30, 60);
  Barrier2 [262] = new Barrier2 (420, 0, 60, 30);
  Barrier2 [263] = new Barrier2 (480, 0, 30, 90);
  Barrier2 [264] = new Barrier2 (0, 90, 150, 30);
  Barrier2 [265] = new Barrier2 (0, -60, 30, 150);
  Barrier2 [266] = new Barrier2 (0, -60, 90, 30);
  Barrier2 [267] = new Barrier2 (60, -60, 30, 120);
  Barrier2 [268] = new Barrier2 (60, -30, 150, 30);
  Barrier2 [269] = new Barrier2 (120, 30, 30, 90);
  Barrier2 [270] = new Barrier2 (120, 60, 150, 30);
  Barrier2 [271] = new Barrier2 (180, -30, 30, 60);
  Barrier2 [272] = new Barrier2 (180, 0, 60, 30);
  Barrier2 [273] = new Barrier2 (240, 0, 30, 90);
  Barrier2 [274] = new Barrier2 (720, 90, 150, 30);
  Barrier2 [275] = new Barrier2 (720, -60, 30, 150);
  Barrier2 [276] = new Barrier2 (720, -60, 90, 30);
  Barrier2 [277] = new Barrier2 (780, -60, 30, 120);
  Barrier2 [278] = new Barrier2 (780, -30, 150, 30);
  Barrier2 [279] = new Barrier2 (840, 30, 30, 90);
  Barrier2 [280] = new Barrier2 (840, 60, 150, 30);
  Barrier2 [281] = new Barrier2 (900, -30, 30, 60);
  Barrier2 [282] = new Barrier2 (900, 0, 60, 30);
  Barrier2 [283] = new Barrier2 (960, 0, 30, 90);
  Barrier2 [284] = new Barrier2 (960, 90, 150, 30);
  Barrier2 [285] = new Barrier2 (960, -60, 30, 150);
  Barrier2 [286] = new Barrier2 (960, -60, 90, 30);
  Barrier2 [287] = new Barrier2 (1020, -60, 30, 120);
  Barrier2 [288] = new Barrier2 (1020, -30, 150, 30);
  Barrier2 [289] = new Barrier2 (1080, 30, 30, 90);
  Barrier2 [290] = new Barrier2 (1080, 60, 150, 30);
  Barrier2 [291] = new Barrier2 (1140, -30, 30, 60);
  Barrier2 [292] = new Barrier2 (1140, 0, 60, 30);
  Barrier2 [293] = new Barrier2 (1200, 0, 30, 90);
  Barrier2 [294] = new Barrier2 (1200, 90, 150, 30);
  Barrier2 [295] = new Barrier2 (1200, -60, 30, 150);
  Barrier2 [296] = new Barrier2 (1200, -60, 90, 30);
  Barrier2 [297] = new Barrier2 (1260, -60, 30, 120);
  Barrier2 [298] = new Barrier2 (1260, -30, 150, 30);
  Barrier2 [299] = new Barrier2 (1320, 30, 30, 90);
  Barrier2 [300] = new Barrier2 (1320, 60, 150, 30);
  Barrier2 [301] = new Barrier2 (1380, -30, 30, 60);
  Barrier2 [302] = new Barrier2 (1380, 0, 30, 60);
  Barrier2 [303] = new Barrier2 (1440, 0, 30, 90);

  ///Maze 3///

  Barrier3 = new Barrier3 [93];
  Barrier3 [0] = new Barrier3 (0, 0, 1400, 30);
  Barrier3 [1] = new Barrier3 (0, 0, 30, 780);
  Barrier3 [2] = new Barrier3 (60, 0, 30, 780);
  Barrier3 [3] = new Barrier3 (0, 60, 1400, 30);
  Barrier3 [4] = new Barrier3 (60, 60, 1400, 30);
  Barrier3 [5] = new Barrier3 (120, 120, 30, 30);
  Barrier3 [6] = new Barrier3 (180, 0, 30, 780);
  Barrier3 [7] = new Barrier3 (0, 180, 1400, 30);
  Barrier3 [8] = new Barrier3 (180, 180, 30, 30);
  Barrier3 [9] = new Barrier3 (0, 300, 1400, 30);
  Barrier3 [10] = new Barrier3 (0, 420, 1400, 30);
  Barrier3 [11] = new Barrier3 (0, 540, 1400, 30);
  Barrier3 [12] = new Barrier3 (0, 660, 1400, 30);
  Barrier3 [13] = new Barrier3 (0, 720, 1400, 30);
  Barrier3 [14] = new Barrier3 (300, 0, 30, 780);
  Barrier3 [15] = new Barrier3 (420, 0, 30, 780);
  Barrier3 [16] = new Barrier3 (540, 0, 30, 780);
  Barrier3 [17] = new Barrier3 (660, 0, 30, 780);
  Barrier3 [18] = new Barrier3 (780, 0, 30, 780);
  Barrier3 [19] = new Barrier3 (900, 0, 30, 780);
  Barrier3 [20] = new Barrier3 (1020, 0, 30, 780);
  Barrier3 [21] = new Barrier3 (1140, 0, 30, 780);
  Barrier3 [22] = new Barrier3 (1260, 0, 30, 780);
  Barrier3 [23] = new Barrier3 (1320, 0, 30, 780);
  Barrier3 [24] = new Barrier3 (240, 120, 30, 30);
  Barrier3 [25] = new Barrier3 (240, 240, 30, 30);
  Barrier3 [26] = new Barrier3 (240, 300, 30, 30);
  Barrier3 [27] = new Barrier3 (240, 360, 30, 30);
  Barrier3 [28] = new Barrier3 (240, 420, 30, 30);
  Barrier3 [29] = new Barrier3 (240, 480, 30, 30);
  Barrier3 [30] = new Barrier3 (240, 600, 30, 30);
  Barrier3 [31] = new Barrier3 (120, 240, 30, 30);
  Barrier3 [32] = new Barrier3 (120, 300, 30, 30);
  Barrier3 [33] = new Barrier3 (120, 360, 30, 30);
  Barrier3 [34] = new Barrier3 (120, 420, 30, 30);
  Barrier3 [35] = new Barrier3 (120, 480, 30, 30);
  Barrier3 [36] = new Barrier3 (120, 600, 30, 30);
  Barrier3 [37] = new Barrier3 (360, 120, 30, 30);
  Barrier3 [38] = new Barrier3 (360, 240, 30, 30);
  Barrier3 [39] = new Barrier3 (360, 300, 30, 30);
  Barrier3 [40] = new Barrier3 (360, 360, 30, 30);
  Barrier3 [41] = new Barrier3 (360, 420, 30, 30);
  Barrier3 [42] = new Barrier3 (360, 480, 30, 30);
  Barrier3 [43] = new Barrier3 (360, 600, 30, 30);
  Barrier3 [44] = new Barrier3 (480, 120, 30, 30);
  Barrier3 [45] = new Barrier3 (480, 240, 30, 30);
  Barrier3 [46] = new Barrier3 (480, 300, 30, 30);
  Barrier3 [47] = new Barrier3 (480, 360, 30, 30);
  Barrier3 [48] = new Barrier3 (480, 420, 30, 30);
  Barrier3 [49] = new Barrier3 (480, 480, 30, 30);
  Barrier3 [50] = new Barrier3 (480, 600, 30, 30);
  Barrier3 [51] = new Barrier3 (600, 120, 30, 30);
  Barrier3 [52] = new Barrier3 (600, 240, 30, 30);
  Barrier3 [53] = new Barrier3 (600, 300, 30, 30);
  Barrier3 [54] = new Barrier3 (600, 360, 30, 30);
  Barrier3 [55] = new Barrier3 (600, 420, 30, 30);
  Barrier3 [56] = new Barrier3 (600, 480, 30, 30);
  Barrier3 [57] = new Barrier3 (600, 600, 30, 30);
  Barrier3 [58] = new Barrier3 (720, 120, 30, 30);
  Barrier3 [59] = new Barrier3 (720, 240, 30, 30);
  Barrier3 [60] = new Barrier3 (720, 300, 30, 30);
  Barrier3 [61] = new Barrier3 (720, 360, 30, 30);
  Barrier3 [62] = new Barrier3 (720, 420, 30, 30);
  Barrier3 [63] = new Barrier3 (720, 480, 30, 30);
  Barrier3 [64] = new Barrier3 (720, 600, 30, 30);
  Barrier3 [65] = new Barrier3 (840, 120, 30, 30);
  Barrier3 [66] = new Barrier3 (840, 240, 30, 30);
  Barrier3 [67] = new Barrier3 (840, 300, 30, 30);
  Barrier3 [68] = new Barrier3 (840, 360, 30, 30);
  Barrier3 [69] = new Barrier3 (840, 420, 30, 30);
  Barrier3 [70] = new Barrier3 (840, 480, 30, 30);
  Barrier3 [71] = new Barrier3 (840, 600, 30, 30);
  Barrier3 [72] = new Barrier3 (960, 120, 30, 30);
  Barrier3 [73] = new Barrier3 (960, 240, 30, 30);
  Barrier3 [74] = new Barrier3 (960, 300, 30, 30);
  Barrier3 [75] = new Barrier3 (960, 360, 30, 30);
  Barrier3 [76] = new Barrier3 (960, 420, 30, 30);
  Barrier3 [77] = new Barrier3 (960, 480, 30, 30);
  Barrier3 [78] = new Barrier3 (960, 600, 30, 30);
  Barrier3 [79] = new Barrier3 (1080, 120, 30, 30);
  Barrier3 [80] = new Barrier3 (1080, 240, 30, 30);
  Barrier3 [81] = new Barrier3 (1080, 300, 30, 30);
  Barrier3 [82] = new Barrier3 (1080, 360, 30, 30);
  Barrier3 [83] = new Barrier3 (1080, 420, 30, 30);
  Barrier3 [84] = new Barrier3 (1080, 480, 30, 30);
  Barrier3 [85] = new Barrier3 (1080, 600, 30, 30);
  Barrier3 [86] = new Barrier3 (1200, 120, 30, 30);
  Barrier3 [87] = new Barrier3 (1200, 240, 30, 30);
  Barrier3 [88] = new Barrier3 (1200, 300, 30, 30);
  Barrier3 [89] = new Barrier3 (1200, 360, 30, 30);
  Barrier3 [90] = new Barrier3 (1200, 420, 30, 30);
  Barrier3 [91] = new Barrier3 (1200, 480, 30, 30);
  Barrier3 [92] = new Barrier3 (1200, 600, 30, 30);

  ///Maze 4///

  Barrier4 = new Barrier4 [239];
  Barrier4 [0] = new Barrier4 (0, 0, 90, 30);
  Barrier4 [1] = new Barrier4 (0, 0, 30, 750);
  Barrier4 [2] = new Barrier4 (60, 0, 30, 90);
  Barrier4 [3] = new Barrier4 (0, 60, 150, 30);
  Barrier4 [4] = new Barrier4 (120, 30, 30, 210);
  Barrier4 [5] = new Barrier4 (120, 30, 90, 30);
  Barrier4 [6] = new Barrier4 (180, 30, 30, 150);
  Barrier4 [7] = new Barrier4 (120, 210, 210, 30);
  Barrier4 [8] = new Barrier4 (180, 150, 90, 30);
  Barrier4 [9] = new Barrier4 (240, 0, 30, 150);
  Barrier4 [10] = new Barrier4 (240, 0, 90, 30);
  Barrier4 [11] = new Barrier4 (300, 0, 30, 240);
  Barrier4 [12] = new Barrier4 (300, 30, 30, 210);
  Barrier4 [13] = new Barrier4 (300, 30, 90, 30);
  Barrier4 [14] = new Barrier4 (360, 30, 30, 150);
  Barrier4 [15] = new Barrier4 (300, 210, 210, 30);
  Barrier4 [16] = new Barrier4 (360, 150, 90, 30);
  Barrier4 [17] = new Barrier4 (420, 0, 30, 150);
  Barrier4 [18] = new Barrier4 (420, 0, 90, 30);
  Barrier4 [19] = new Barrier4 (480, 0, 30, 240);
  Barrier4 [20] = new Barrier4 (480, 30, 30, 210);
  Barrier4 [21] = new Barrier4 (480, 30, 90, 30);
  Barrier4 [22] = new Barrier4 (540, 30, 30, 150);
  Barrier4 [23] = new Barrier4 (480, 210, 210, 30);
  Barrier4 [24] = new Barrier4 (540, 150, 90, 30);
  Barrier4 [25] = new Barrier4 (600, 0, 30, 150);
  Barrier4 [26] = new Barrier4 (600, 0, 90, 30);
  Barrier4 [27] = new Barrier4 (660, 0, 30, 240);
  Barrier4 [28] = new Barrier4 (660, 30, 30, 210);
  Barrier4 [29] = new Barrier4 (660, 30, 90, 30);
  Barrier4 [30] = new Barrier4 (720, 30, 30, 150);
  Barrier4 [31] = new Barrier4 (660, 210, 210, 30);
  Barrier4 [32] = new Barrier4 (720, 150, 90, 30);
  Barrier4 [33] = new Barrier4 (780, 0, 30, 150);
  Barrier4 [34] = new Barrier4 (780, 0, 90, 30);
  Barrier4 [35] = new Barrier4 (840, 0, 30, 240);
  Barrier4 [36] = new Barrier4 (840, 30, 30, 210);
  Barrier4 [37] = new Barrier4 (840, 30, 90, 30);
  Barrier4 [38] = new Barrier4 (900, 30, 30, 150);
  Barrier4 [39] = new Barrier4 (840, 210, 210, 30);
  Barrier4 [40] = new Barrier4 (900, 150, 90, 30);
  Barrier4 [41] = new Barrier4 (960, 0, 30, 150);
  Barrier4 [42] = new Barrier4 (960, 0, 90, 30);
  Barrier4 [43] = new Barrier4 (1020, 0, 30, 240);
  Barrier4 [44] = new Barrier4 (1020, 30, 30, 210);
  Barrier4 [45] = new Barrier4 (1020, 30, 90, 30);
  Barrier4 [46] = new Barrier4 (1080, 30, 30, 150);
  Barrier4 [47] = new Barrier4 (1020, 210, 210, 30);
  Barrier4 [48] = new Barrier4 (1080, 150, 90, 30);
  Barrier4 [49] = new Barrier4 (1140, 0, 30, 150);
  Barrier4 [50] = new Barrier4 (1140, 0, 90, 30);
  Barrier4 [51] = new Barrier4 (1200, 0, 30, 240);
  Barrier4 [52] = new Barrier4 (1200, 30, 30, 210);
  Barrier4 [53] = new Barrier4 (1200, 30, 90, 30);
  Barrier4 [54] = new Barrier4 (1260, 30, 30, 150);
  Barrier4 [55] = new Barrier4 (1200, 210, 210, 30);
  Barrier4 [56] = new Barrier4 (1260, 150, 90, 30);
  Barrier4 [57] = new Barrier4 (1320, 0, 30, 150);
  Barrier4 [58] = new Barrier4 (1320, 0, 90, 30);
  Barrier4 [59] = new Barrier4 (1380, 0, 30, 240);
  Barrier4 [60] = new Barrier4 (120, 180, 30, 210);
  Barrier4 [61] = new Barrier4 (120, 150, 90, 30);
  Barrier4 [62] = new Barrier4 (180, 180, 30, 120);
  Barrier4 [63] = new Barrier4 (120, 360, 210, 30);
  Barrier4 [64] = new Barrier4 (180, 300, 90, 30);
  Barrier4 [65] = new Barrier4 (240, 150, 30, 150);
  Barrier4 [66] = new Barrier4 (240, 150, 90, 30);
  Barrier4 [67] = new Barrier4 (300, 180, 30, 210);
  Barrier4 [68] = new Barrier4 (300, 180, 30, 210);
  Barrier4 [69] = new Barrier4 (300, 150, 90, 30);
  Barrier4 [70] = new Barrier4 (360, 180, 30, 120);
  Barrier4 [71] = new Barrier4 (300, 360, 210, 30);
  Barrier4 [72] = new Barrier4 (360, 300, 90, 30);
  Barrier4 [73] = new Barrier4 (420, 150, 30, 150);
  Barrier4 [74] = new Barrier4 (420, 150, 90, 30);
  Barrier4 [75] = new Barrier4 (480, 180, 30, 210);
  Barrier4 [76] = new Barrier4 (480, 180, 30, 210);
  Barrier4 [77] = new Barrier4 (480, 150, 90, 30);
  Barrier4 [78] = new Barrier4 (540, 180, 30, 120);
  Barrier4 [79] = new Barrier4 (480, 360, 210, 30);
  Barrier4 [80] = new Barrier4 (540, 300, 90, 30);
  Barrier4 [81] = new Barrier4 (600, 150, 30, 150);
  Barrier4 [82] = new Barrier4 (600, 150, 90, 30);
  Barrier4 [83] = new Barrier4 (660, 180, 30, 210);
  Barrier4 [84] = new Barrier4 (660, 180, 30, 210);
  Barrier4 [85] = new Barrier4 (660, 150, 90, 30);
  Barrier4 [86] = new Barrier4 (720, 180, 30, 120);
  Barrier4 [87] = new Barrier4 (660, 360, 210, 30);
  Barrier4 [88] = new Barrier4 (720, 300, 90, 30);
  Barrier4 [89] = new Barrier4 (780, 150, 30, 150);
  Barrier4 [90] = new Barrier4 (780, 150, 90, 30);
  Barrier4 [91] = new Barrier4 (840, 180, 30, 210);
  Barrier4 [92] = new Barrier4 (840, 180, 30, 210);
  Barrier4 [93] = new Barrier4 (840, 150, 90, 30);
  Barrier4 [94] = new Barrier4 (900, 180, 30, 120);
  Barrier4 [95] = new Barrier4 (840, 360, 210, 30);
  Barrier4 [96] = new Barrier4 (900, 300, 90, 30);
  Barrier4 [97] = new Barrier4 (960, 150, 30, 150);
  Barrier4 [98] = new Barrier4 (960, 150, 90, 30);
  Barrier4 [99] = new Barrier4 (1020, 180, 30, 210);
  Barrier4 [100] = new Barrier4 (1020, 180, 30, 210);
  Barrier4 [101] = new Barrier4 (1020, 150, 90, 30);
  Barrier4 [102] = new Barrier4 (1080, 180, 30, 150);
  Barrier4 [103] = new Barrier4 (1020, 360, 210, 30);
  Barrier4 [104] = new Barrier4 (1080, 300, 90, 30);
  Barrier4 [105] = new Barrier4 (1140, 150, 30, 150);
  Barrier4 [106] = new Barrier4 (1140, 150, 90, 30);
  Barrier4 [107] = new Barrier4 (1200, 180, 30, 210);
  Barrier4 [108] = new Barrier4 (1200, 180, 30, 210);
  Barrier4 [109] = new Barrier4 (1200, 150, 90, 30);
  Barrier4 [110] = new Barrier4 (1260, 180, 30, 150);
  Barrier4 [111] = new Barrier4 (1200, 360, 210, 30);
  Barrier4 [112] = new Barrier4 (1260, 300, 90, 30);
  Barrier4 [113] = new Barrier4 (1320, 150, 30, 150);
  Barrier4 [114] = new Barrier4 (1320, 150, 90, 30);
  Barrier4 [115] = new Barrier4 (1380, 180, 30, 210);
  Barrier4 [116] = new Barrier4 (120, 390, 30, 210);
  Barrier4 [117] = new Barrier4 (120, 390, 90, 30);
  Barrier4 [118] = new Barrier4 (180, 390, 30, 150);
  Barrier4 [119] = new Barrier4 (120, 570, 210, 30);
  Barrier4 [120] = new Barrier4 (180, 510, 90, 30);
  Barrier4 [121] = new Barrier4 (240, 360, 30, 150);
  Barrier4 [122] = new Barrier4 (240, 360, 90, 30);
  Barrier4 [123] = new Barrier4 (300, 360, 30, 240);
  Barrier4 [124] = new Barrier4 (300, 390, 30, 210);
  Barrier4 [125] = new Barrier4 (300, 390, 90, 30);
  Barrier4 [126] = new Barrier4 (360, 390, 30, 150);
  Barrier4 [127] = new Barrier4 (300, 570, 210, 30);
  Barrier4 [128] = new Barrier4 (360, 510, 90, 30);
  Barrier4 [129] = new Barrier4 (420, 360, 30, 150);
  Barrier4 [130] = new Barrier4 (420, 360, 90, 30);
  Barrier4 [131] = new Barrier4 (480, 360, 30, 240);
  Barrier4 [132] = new Barrier4 (480, 390, 30, 210);
  Barrier4 [133] = new Barrier4 (480, 390, 90, 30);
  Barrier4 [134] = new Barrier4 (540, 390, 30, 150);
  Barrier4 [135] = new Barrier4 (480, 570, 210, 30);
  Barrier4 [136] = new Barrier4 (540, 510, 90, 30);
  Barrier4 [137] = new Barrier4 (600, 360, 30, 150);
  Barrier4 [138] = new Barrier4 (600, 360, 90, 30);
  Barrier4 [139] = new Barrier4 (660, 360, 30, 240);
  Barrier4 [140] = new Barrier4 (660, 390, 30, 210);
  Barrier4 [141] = new Barrier4 (660, 390, 90, 30);
  Barrier4 [142] = new Barrier4 (720, 390, 30, 150);
  Barrier4 [143] = new Barrier4 (660, 570, 210, 30);
  Barrier4 [144] = new Barrier4 (720, 510, 90, 30);
  Barrier4 [145] = new Barrier4 (780, 360, 30, 150);
  Barrier4 [146] = new Barrier4 (780, 360, 90, 30);
  Barrier4 [147] = new Barrier4 (840, 360, 30, 240);
  Barrier4 [148] = new Barrier4 (840, 390, 30, 210);
  Barrier4 [149] = new Barrier4 (840, 390, 90, 30);
  Barrier4 [150] = new Barrier4 (900, 390, 30, 150);
  Barrier4 [151] = new Barrier4 (840, 570, 210, 30);
  Barrier4 [152] = new Barrier4 (900, 510, 90, 30);
  Barrier4 [153] = new Barrier4 (960, 360, 30, 150);
  Barrier4 [154] = new Barrier4 (960, 360, 90, 30);
  Barrier4 [155] = new Barrier4 (1020, 360, 30, 240);
  Barrier4 [156] = new Barrier4 (1020, 390, 30, 210);
  Barrier4 [157] = new Barrier4 (1020, 390, 90, 30);
  Barrier4 [158] = new Barrier4 (1080, 390, 30, 150);
  Barrier4 [159] = new Barrier4 (1020, 570, 210, 30);
  Barrier4 [160] = new Barrier4 (1080, 510, 90, 30);
  Barrier4 [161] = new Barrier4 (1140, 360, 30, 150);
  Barrier4 [162] = new Barrier4 (1140, 360, 90, 30);
  Barrier4 [163] = new Barrier4 (1200, 360, 30, 240);
  Barrier4 [164] = new Barrier4 (1200, 390, 30, 210);
  Barrier4 [165] = new Barrier4 (1200, 390, 90, 30);
  Barrier4 [166] = new Barrier4 (1260, 390, 30, 150);
  Barrier4 [167] = new Barrier4 (1200, 570, 210, 30);
  Barrier4 [168] = new Barrier4 (1260, 510, 90, 30);
  Barrier4 [169] = new Barrier4 (1320, 360, 30, 150);
  Barrier4 [170] = new Barrier4 (1320, 360, 90, 30);
  Barrier4 [171] = new Barrier4 (1380, 360, 30, 240);
  Barrier4 [172] = new Barrier4 (120, 540, 30, 210);
  Barrier4 [173] = new Barrier4 (120, 510, 90, 30);
  Barrier4 [174] = new Barrier4 (180, 540, 30, 120);
  Barrier4 [175] = new Barrier4 (120, 720, 210, 30);
  Barrier4 [176] = new Barrier4 (180, 660, 90, 30);
  Barrier4 [177] = new Barrier4 (240, 510, 30, 150);
  Barrier4 [178] = new Barrier4 (240, 510, 90, 30);
  Barrier4 [179] = new Barrier4 (300, 540, 30, 210);
  Barrier4 [180] = new Barrier4 (300, 540, 30, 210);
  Barrier4 [181] = new Barrier4 (300, 510, 90, 30);
  Barrier4 [182] = new Barrier4 (360, 540, 30, 120);
  Barrier4 [183] = new Barrier4 (300, 720, 210, 30);
  Barrier4 [184] = new Barrier4 (360, 660, 90, 30);
  Barrier4 [185] = new Barrier4 (420, 510, 30, 150);
  Barrier4 [186] = new Barrier4 (420, 510, 90, 30);
  Barrier4 [187] = new Barrier4 (480, 540, 30, 210);
  Barrier4 [188] = new Barrier4 (480, 540, 30, 210);
  Barrier4 [189] = new Barrier4 (480, 510, 90, 30);
  Barrier4 [190] = new Barrier4 (540, 540, 30, 120);
  Barrier4 [191] = new Barrier4 (480, 720, 210, 30);
  Barrier4 [192] = new Barrier4 (540, 660, 90, 30);
  Barrier4 [193] = new Barrier4 (600, 510, 30, 150);
  Barrier4 [194] = new Barrier4 (600, 510, 90, 30);
  Barrier4 [195] = new Barrier4 (660, 540, 30, 210);
  Barrier4 [196] = new Barrier4 (660, 540, 30, 210);
  Barrier4 [197] = new Barrier4 (660, 510, 90, 30);
  Barrier4 [198] = new Barrier4 (720, 540, 30, 120);
  Barrier4 [199] = new Barrier4 (660, 720, 210, 30);
  Barrier4 [200] = new Barrier4 (720, 660, 90, 30);
  Barrier4 [201] = new Barrier4 (780, 510, 30, 150);
  Barrier4 [202] = new Barrier4 (780, 510, 90, 30);
  Barrier4 [203] = new Barrier4 (840, 540, 30, 210);
  Barrier4 [204] = new Barrier4 (840, 540, 30, 210);
  Barrier4 [205] = new Barrier4 (840, 510, 90, 30);
  Barrier4 [206] = new Barrier4 (900, 540, 30, 120);
  Barrier4 [207] = new Barrier4 (840, 720, 210, 30);
  Barrier4 [208] = new Barrier4 (900, 660, 90, 30);
  Barrier4 [209] = new Barrier4 (960, 510, 30, 150);
  Barrier4 [210] = new Barrier4 (960, 510, 90, 30);
  Barrier4 [211] = new Barrier4 (1020, 540, 30, 210);
  Barrier4 [212] = new Barrier4 (1020, 540, 30, 210);
  Barrier4 [213] = new Barrier4 (1020, 510, 90, 30);
  Barrier4 [214] = new Barrier4 (1080, 540, 30, 120);
  Barrier4 [215] = new Barrier4 (1020, 720, 210, 30);
  Barrier4 [216] = new Barrier4 (1080, 660, 90, 30);
  Barrier4 [217] = new Barrier4 (1140, 510, 30, 150);
  Barrier4 [218] = new Barrier4 (1140, 510, 90, 30);
  Barrier4 [219] = new Barrier4 (1200, 540, 30, 210);
  Barrier4 [220] = new Barrier4 (1200, 540, 30, 210);
  Barrier4 [221] = new Barrier4 (1200, 510, 90, 30);
  Barrier4 [222] = new Barrier4 (1260, 540, 30, 120);
  Barrier4 [223] = new Barrier4 (1200, 720, 210, 30);
  Barrier4 [224] = new Barrier4 (1260, 660, 90, 30);
  Barrier4 [225] = new Barrier4 (1320, 510, 30, 150);
  Barrier4 [226] = new Barrier4 (1320, 510, 90, 30);
  Barrier4 [227] = new Barrier4 (1380, 540, 30, 210);
  Barrier4 [228] = new Barrier4 (0, 120, 120, 30);
  Barrier4 [229] = new Barrier4 (0, 180, 120, 30);
  Barrier4 [230] = new Barrier4 (0, 240, 120, 30);
  Barrier4 [231] = new Barrier4 (0, 300, 120, 30);
  Barrier4 [232] = new Barrier4 (0, 360, 120, 30);
  Barrier4 [233] = new Barrier4 (0, 420, 120, 30);
  Barrier4 [234] = new Barrier4 (0, 480, 120, 30);
  Barrier4 [235] = new Barrier4 (0, 540, 120, 30);
  Barrier4 [236] = new Barrier4 (0, 600, 120, 30);
  Barrier4 [237] = new Barrier4 (0, 660, 120, 30);
  Barrier4 [238] = new Barrier4 (0, 720, 120, 30);

  ///Maze 5///

  Barrier5 = new Barrier5 [91];
  Barrier5 [0] = new Barrier5 (0, 0, 1350, 30);
  Barrier5 [1] = new Barrier5 (0, 0, 30, 750);
  Barrier5 [2] = new Barrier5 (1320, 0, 30, 750);
  Barrier5 [3] = new Barrier5 (60, 670, 1350, 30);
  Barrier5 [4] = new Barrier5 (0, 610, 1350, 30);
  Barrier5 [5] = new Barrier5 (60, 550, 1350, 30);
  Barrier5 [6] = new Barrier5 (60, 520, 30, 60);
  Barrier5 [7] = new Barrier5 (180, 520, 30, 60);
  Barrier5 [8] = new Barrier5 (300, 520, 30, 60);
  Barrier5 [9] = new Barrier5 (420, 430, 30, 150);
  Barrier5 [10] = new Barrier5 (480, 460, 180, 30);
  Barrier5 [11] = new Barrier5 (420, 520, 60, 60);
  Barrier5 [12] = new Barrier5 (570, 520, 30, 60);
  Barrier5 [13] = new Barrier5 (180, 460, 30, 60);
  Barrier5 [14] = new Barrier5 (00, 460, 120, 30);
  Barrier5 [15] = new Barrier5 (120, 400, 30, 120); 
  Barrier5 [16] = new Barrier5 (150, 400, 120, 30);
  Barrier5 [17] = new Barrier5 (240, 340, 30, 180);
  Barrier5 [18] = new Barrier5 (270, 460, 120, 30);
  Barrier5 [19] = new Barrier5 (360, 460, 30, 60);
  Barrier5 [20] = new Barrier5 (300, 400, 300, 30);
  Barrier5 [21] = new Barrier5 (60, 280, 1350, 30);
  Barrier5 [22] = new Barrier5 (270, 340, 930, 30);
  Barrier5 [23] = new Barrier5 (510, 460, 30, 60);
  Barrier5 [24] = new Barrier5 (60, 280, 30, 150);
  Barrier5 [25] = new Barrier5 (630, 340, 30, 180);
  Barrier5 [26] = new Barrier5 (630, 430, 60, 30);
  Barrier5 [27] = new Barrier5 (630, 340, 60, 60);
  Barrier5 [28] = new Barrier5 (690, 490, 30, 90);
  Barrier5 [29] = new Barrier5 (720, 430, 30, 90);
  Barrier5 [30] = new Barrier5 (720, 340, 30, 60);
  Barrier5 [31] = new Barrier5 (780, 340, 30, 60);
  Barrier5 [32] = new Barrier5 (780, 430, 30, 90);
  Barrier5 [33] = new Barrier5 (810, 370, 30, 90);
  Barrier5 [34] = new Barrier5 (840, 490, 30, 60);
  Barrier5 [35] = new Barrier5 (900, 400, 30, 150);
  Barrier5 [36] = new Barrier5 (870, 430, 60, 30);
  Barrier5 [37] = new Barrier5 (810, 370, 60, 30);
  Barrier5 [38] = new Barrier5 (960, 370, 30, 150); 
  Barrier5 [39] = new Barrier5 (1020, 400, 30, 150); 
  Barrier5 [40] = new Barrier5 (1080, 370, 30, 150);
  Barrier5 [41] = new Barrier5 (1140, 400, 30, 150);
  Barrier5 [42] = new Barrier5 (1140, 400, 60, 30);
  Barrier5 [43] = new Barrier5 (1200, 460, 60, 30);
  Barrier5 [44] = new Barrier5 (1140, 520, 60, 30);
  Barrier5 [45] = new Barrier5 (0, 220, 90, 30);
  Barrier5 [46] = new Barrier5 (120, 160, 30, 210);
  Barrier5 [47] = new Barrier5 (180, 340, 30, 30);
  Barrier5 [48] = new Barrier5 (90, 160, 60, 30);
  Barrier5 [49] = new Barrier5 (0, 160, 60, 30);
  Barrier5 [50] = new Barrier5 (0, 100, 210, 30);
  Barrier5 [51] = new Barrier5 (180, 60, 30, 190);
  Barrier5 [52] = new Barrier5 (180, 160, 330, 30);
  Barrier5 [53] = new Barrier5 (210, 160, 30, 60);
  Barrier5 [54] = new Barrier5 (240, 250, 30, 60);
  Barrier5 [55] = new Barrier5 (270, 160, 30, 60);
  Barrier5 [56] = new Barrier5 (300, 220, 30, 30);
  Barrier5 [57] = new Barrier5 (360, 220, 30, 90);
  Barrier5 [58] = new Barrier5 (420, 160, 30, 90);
  Barrier5 [59] = new Barrier5 (480, 220, 30, 90);
  Barrier5 [60] = new Barrier5 (540, 100, 30, 210);
  Barrier5 [61] = new Barrier5 (240, 100, 150, 30);
  Barrier5 [62] = new Barrier5 (420, 100, 30, 30);
  Barrier5 [63] = new Barrier5 (480, 100, 30, 30);
  Barrier5 [64] = new Barrier5 (180, 60, 450, 30);
  Barrier5 [65] = new Barrier5 (600, 60, 30, 210);
  Barrier5 [66] = new Barrier5 (600, 60, 390, 30);
  Barrier5 [67] = new Barrier5 (720, 120, 180, 30);
  Barrier5 [68] = new Barrier5 (750, 150, 180, 30);
  Barrier5 [69] = new Barrier5 (780, 180, 180, 30);
  Barrier5 [70] = new Barrier5 (810, 210, 180, 30);
  Barrier5 [71] = new Barrier5 (840, 240, 180, 30);
  Barrier5 [72] = new Barrier5 (870, 270, 180, 30);
  Barrier5 [73] = new Barrier5 (600, 240, 180, 30);
  Barrier5 [74] = new Barrier5 (600, 210, 150, 30);
  Barrier5 [75] = new Barrier5 (600, 180, 120, 30);
  Barrier5 [76] = new Barrier5 (600, 150, 90, 30);
  Barrier5 [77] = new Barrier5 (600, 120, 60, 30);
  Barrier5 [78] = new Barrier5 (600, 90, 90, 30);
  Barrier5 [79] = new Barrier5 (120, 0, 30, 750);
  Barrier5 [80] = new Barrier5 (180, 0, 30, 750);
  Barrier5 [81] = new Barrier5 (300, 0, 30, 750);
  Barrier5 [82] = new Barrier5 (420, 0, 30, 750);
  Barrier5 [83] = new Barrier5 (540, 0, 30, 750);
  Barrier5 [84] = new Barrier5 (660, 0, 30, 750);
  Barrier5 [85] = new Barrier5 (780, 0, 30, 750);
  Barrier5 [86] = new Barrier5 (900, 0, 30, 750);
  Barrier5 [87] = new Barrier5 (1020, 0, 30, 750);
  Barrier5 [88] = new Barrier5 (1140, 0, 30, 750);
  Barrier5 [89] = new Barrier5 (1260, 0, 30, 750);
  Barrier5 [90] = new Barrier5 (60, 0, 30, 750);

  ///Maze 6///

  Barrier6 = new Barrier6 [102];
  Barrier6 [0] = new Barrier6 (0, -30, 210, 210);
  Barrier6 [1] = new Barrier6 (120, -30, 210, 210);
  Barrier6 [2] = new Barrier6 (240, -30, 210, 210);
  Barrier6 [3] = new Barrier6 (360, -30, 210, 210);
  Barrier6 [4] = new Barrier6 (480, -30, 210, 210);
  Barrier6 [5] = new Barrier6 (600, -30, 210, 210);
  Barrier6 [6] = new Barrier6 (120, -30, 210, 210);
  Barrier6 [7] = new Barrier6 (240, -30, 210, 210);
  Barrier6 [8] = new Barrier6 (360, -30, 210, 210);
  Barrier6 [9] = new Barrier6 (480, -30, 210, 210);
  Barrier6 [10] = new Barrier6 (600, -30, 210, 210);
  Barrier6 [11] = new Barrier6 (720, -30, 210, 210);
  Barrier6 [12] = new Barrier6 (840, -30, 210, 210);
  Barrier6 [13] = new Barrier6 (960, -30, 210, 210);
  Barrier6 [14] = new Barrier6 (1080, -30, 210, 210);
  Barrier6 [15] = new Barrier6 (1200, -30, 210, 210);
  Barrier6 [16] = new Barrier6 (1320, -30, 210, 210);
  Barrier6 [17] = new Barrier6 (1440, -30, 210, 210);
  Barrier6 [18] = new Barrier6 (0, 300, 150, 150);
  Barrier6 [19] = new Barrier6 (120, 300, 150, 150);
  Barrier6 [20] = new Barrier6 (240, 300, 150, 150);
  Barrier6 [21] = new Barrier6 (360, 300, 150, 150);
  Barrier6 [22] = new Barrier6 (480, 300, 150, 150);
  Barrier6 [23] = new Barrier6 (600, 300, 150, 150);
  Barrier6 [24] = new Barrier6 (720, 300, 150, 150);
  Barrier6 [25] = new Barrier6 (840, 300, 150, 150);
  Barrier6 [26] = new Barrier6 (960, 300, 150, 150);
  Barrier6 [27] = new Barrier6 (1080, 300, 150, 150);
  Barrier6 [28] = new Barrier6 (1200, 300, 150, 150);
  Barrier6 [29] = new Barrier6 (1320, 300, 150, 150);
  Barrier6 [30] = new Barrier6 (0, 510, 90, 90);
  Barrier6 [31] = new Barrier6 (60, 510, 90, 90);
  Barrier6 [32] = new Barrier6 (120, 510, 90, 90);
  Barrier6 [33] = new Barrier6 (180, 510, 90, 90);
  Barrier6 [34] = new Barrier6 (240, 510, 90, 90);
  Barrier6 [35] = new Barrier6 (300, 510, 90, 90);
  Barrier6 [36] = new Barrier6 (360, 510, 90, 90);
  Barrier6 [37] = new Barrier6 (420, 510, 90, 90);
  Barrier6 [38] = new Barrier6 (480, 510, 90, 90);
  Barrier6 [39] = new Barrier6 (540, 510, 90, 90);
  Barrier6 [40] = new Barrier6 (600, 510, 90, 90);
  Barrier6 [41] = new Barrier6 (660, 510, 90, 90);
  Barrier6 [42] = new Barrier6 (720, 510, 90, 90);
  Barrier6 [43] = new Barrier6 (780, 510, 90, 90);
  Barrier6 [44] = new Barrier6 (840, 510, 90, 90);
  Barrier6 [45] = new Barrier6 (900, 510, 90, 90);
  Barrier6 [46] = new Barrier6 (960, 510, 90, 90);
  Barrier6 [47] = new Barrier6 (1020, 510, 90, 90);
  Barrier6 [48] = new Barrier6 (1080, 510, 90, 90);
  Barrier6 [49] = new Barrier6 (1140, 510, 90, 90);
  Barrier6 [50] = new Barrier6 (1200, 510, 90, 90);
  Barrier6 [51] = new Barrier6 (1260, 510, 90, 90);
  Barrier6 [52] = new Barrier6 (1320, 510, 90, 90);
  Barrier6 [53] = new Barrier6 (1380, 510, 90, 90);
  Barrier6 [54] = new Barrier6 (0, 660, 60, 60);
  Barrier6 [55] = new Barrier6 (30, 660, 60, 60);
  Barrier6 [56] = new Barrier6 (60, 660, 60, 60);
  Barrier6 [57] = new Barrier6 (90, 660, 60, 60);
  Barrier6 [58] = new Barrier6 (120, 660, 60, 60);
  Barrier6 [59] = new Barrier6 (150, 660, 60, 60);
  Barrier6 [60] = new Barrier6 (180, 660, 60, 60);
  Barrier6 [61] = new Barrier6 (210, 660, 60, 60);
  Barrier6 [62] = new Barrier6 (240, 660, 60, 60);
  Barrier6 [63] = new Barrier6 (270, 660, 60, 60);
  Barrier6 [64] = new Barrier6 (300, 660, 60, 60);
  Barrier6 [65] = new Barrier6 (330, 660, 60, 60);
  Barrier6 [66] = new Barrier6 (360, 660, 60, 60);
  Barrier6 [67] = new Barrier6 (390, 660, 60, 60);
  Barrier6 [68] = new Barrier6 (420, 660, 60, 60);
  Barrier6 [69] = new Barrier6 (450, 660, 60, 60);
  Barrier6 [70] = new Barrier6 (480, 660, 60, 60);
  Barrier6 [71] = new Barrier6 (510, 660, 60, 60);
  Barrier6 [72] = new Barrier6 (540, 660, 60, 60);
  Barrier6 [73] = new Barrier6 (570, 660, 60, 60);
  Barrier6 [74] = new Barrier6 (600, 660, 60, 60);
  Barrier6 [75] = new Barrier6 (630, 660, 60, 60);
  Barrier6 [76] = new Barrier6 (660, 660, 60, 60);
  Barrier6 [77] = new Barrier6 (690, 660, 60, 60);
  Barrier6 [78] = new Barrier6 (720, 660, 60, 60);
  Barrier6 [79] = new Barrier6 (750, 660, 60, 60);
  Barrier6 [80] = new Barrier6 (780, 660, 60, 60);
  Barrier6 [81] = new Barrier6 (810, 660, 60, 60);
  Barrier6 [82] = new Barrier6 (840, 660, 60, 60);
  Barrier6 [83] = new Barrier6 (870, 660, 60, 60);
  Barrier6 [84] = new Barrier6 (900, 660, 60, 60);
  Barrier6 [85] = new Barrier6 (930, 660, 60, 60);
  Barrier6 [86] = new Barrier6 (960, 660, 60, 60);
  Barrier6 [87] = new Barrier6 (990, 660, 60, 60);
  Barrier6 [88] = new Barrier6 (1020, 660, 60, 60);
  Barrier6 [89] = new Barrier6 (1050, 660, 60, 60);
  Barrier6 [90] = new Barrier6 (1080, 660, 60, 60);
  Barrier6 [91] = new Barrier6 (1110, 660, 60, 60);
  Barrier6 [92] = new Barrier6 (1140, 660, 60, 60);
  Barrier6 [93] = new Barrier6 (1170, 660, 60, 60);
  Barrier6 [94] = new Barrier6 (1200, 660, 60, 60);
  Barrier6 [95] = new Barrier6 (1230, 660, 60, 60);
  Barrier6 [96] = new Barrier6 (1260, 660, 60, 60);
  Barrier6 [97] = new Barrier6 (1290, 660, 60, 60);
  Barrier6 [98] = new Barrier6 (1310, 660, 60, 60);
  Barrier6 [99] = new Barrier6 (1340, 660, 60, 60);
  Barrier6 [100] = new Barrier6 (1370, 660, 60, 60);
  Barrier6 [101] = new Barrier6 (1400, 660, 60, 60);

  ///Maze 7///

  Barrier7 = new Barrier7 [154];
  Barrier7 [0] = new Barrier7 (0, 0, 90, 10);
  Barrier7 [1] = new Barrier7 (0, 0, 10, 90);
  Barrier7 [2] = new Barrier7 (60, 0, 10, 90);
  Barrier7 [3] = new Barrier7 (0, 60, 90, 10); 
  Barrier7 [4] = new Barrier7 (300, 0, 10, 330);
  Barrier7 [5] = new Barrier7 (300, 0, 90, 10);
  Barrier7 [6] = new Barrier7 (360, 0, 10, 270);
  Barrier7 [7] = new Barrier7 (360, 90, 150, 10);
  Barrier7 [8] = new Barrier7 (420, 150, 10, 180);
  Barrier7 [9] = new Barrier7 (300, 300, 150, 10);
  Barrier7 [10] = new Barrier7 (420, 270, 150, 10);
  Barrier7 [11] = new Barrier7 (480, 90, 10, 150);
  Barrier7 [12] = new Barrier7 (480, 120, 90, 10);
  Barrier7 [13] = new Barrier7 (540, 120, 10, 180);  
  Barrier7 [14] = new Barrier7 (300, 330, 10, 330);
  Barrier7 [15] = new Barrier7 (300, 330, 90, 10);
  Barrier7 [16] = new Barrier7 (360, 330, 10, 270);
  Barrier7 [17] = new Barrier7 (360, 420, 150, 10);
  Barrier7 [18] = new Barrier7 (420, 480, 10, 180);
  Barrier7 [19] = new Barrier7 (300, 630, 150, 10);
  Barrier7 [20] = new Barrier7 (420, 600, 150, 10);
  Barrier7 [21] = new Barrier7 (480, 420, 10, 150);
  Barrier7 [22] = new Barrier7 (480, 450, 90, 10);
  Barrier7 [23] = new Barrier7 (540, 450, 10, 180);
  Barrier7 [24] = new Barrier7 (300, 660, 10, 330);
  Barrier7 [25] = new Barrier7 (300, 660, 90, 10);
  Barrier7 [26] = new Barrier7 (360, 660, 10, 270);
  Barrier7 [27] = new Barrier7 (360, 750, 150, 10);
  Barrier7 [28] = new Barrier7 (420, 810, 10, 180);
  Barrier7 [29] = new Barrier7 (300, 960, 150, 10);
  Barrier7 [30] = new Barrier7 (420, 930, 150, 10);
  Barrier7 [31] = new Barrier7 (480, 750, 10, 150);
  Barrier7 [32] = new Barrier7 (480, 750, 90, 10);
  Barrier7 [33] = new Barrier7 (540, 750, 10, 180);
  Barrier7 [34] = new Barrier7 (600, 0, 10, 330);
  Barrier7 [35] = new Barrier7 (600, 0, 90, 10);
  Barrier7 [36] = new Barrier7 (660, 0, 10, 270);
  Barrier7 [37] = new Barrier7 (660, 90, 150, 10);
  Barrier7 [38] = new Barrier7 (720, 150, 10, 180);
  Barrier7 [39] = new Barrier7 (600, 300, 150, 10);
  Barrier7 [40] = new Barrier7 (720, 270, 150, 10);
  Barrier7 [41] = new Barrier7 (780, 90, 10, 150);
  Barrier7 [42] = new Barrier7 (780, 120, 90, 10);
  Barrier7 [43] = new Barrier7 (840, 120, 10, 180);
  Barrier7 [44] = new Barrier7 (600, 330, 10, 330);
  Barrier7 [45] = new Barrier7 (600, 330, 90, 10);
  Barrier7 [46] = new Barrier7 (660, 330, 10, 270);
  Barrier7 [47] = new Barrier7 (660, 420, 150, 10);
  Barrier7 [48] = new Barrier7 (720, 480, 10, 180);
  Barrier7 [49] = new Barrier7 (600, 630, 150, 10);
  Barrier7 [50] = new Barrier7 (720, 600, 150, 10);
  Barrier7 [51] = new Barrier7 (780, 420, 10, 150);
  Barrier7 [52] = new Barrier7 (780, 450, 90, 10);
  Barrier7 [53] = new Barrier7 (840, 450, 10, 180);
  Barrier7 [54] = new Barrier7 (600, 660, 10, 330);
  Barrier7 [55] = new Barrier7 (600, 660, 90, 10);
  Barrier7 [56] = new Barrier7 (660, 660, 10, 270);
  Barrier7 [57] = new Barrier7 (660, 750, 150, 10);
  Barrier7 [58] = new Barrier7 (720, 810, 10, 180);
  Barrier7 [59] = new Barrier7 (600, 960, 150, 10);
  Barrier7 [60] = new Barrier7 (720, 930, 150, 10);
  Barrier7 [61] = new Barrier7 (780, 750, 10, 150);
  Barrier7 [62] = new Barrier7 (780, 750, 90, 10);
  Barrier7 [63] = new Barrier7 (840, 750, 10, 180);
  Barrier7 [64] = new Barrier7 (900, 0, 10, 330);
  Barrier7 [65] = new Barrier7 (900, 0, 90, 10);
  Barrier7 [66] = new Barrier7 (960, 0, 10, 270);
  Barrier7 [67] = new Barrier7 (960, 90, 150, 10);
  Barrier7 [68] = new Barrier7 (1020, 150, 10, 180);
  Barrier7 [69] = new Barrier7 (900, 300, 150, 10);
  Barrier7 [70] = new Barrier7 (1020, 270, 150, 10);
  Barrier7 [71] = new Barrier7 (1080, 90, 10, 150);
  Barrier7 [72] = new Barrier7 (1080, 120, 90, 10);
  Barrier7 [73] = new Barrier7 (1140, 120, 10, 180);
  Barrier7 [74] = new Barrier7 (900, 330, 10, 330);
  Barrier7 [75] = new Barrier7 (900, 330, 90, 10);
  Barrier7 [76] = new Barrier7 (960, 330, 10, 270);
  Barrier7 [77] = new Barrier7 (960, 420, 150, 10);
  Barrier7 [78] = new Barrier7 (1020, 480, 10, 180);
  Barrier7 [79] = new Barrier7 (900, 630, 150, 10);
  Barrier7 [80] = new Barrier7 (1020, 600, 150, 10);
  Barrier7 [81] = new Barrier7 (1080, 420, 10, 150);
  Barrier7 [82] = new Barrier7 (1080, 450, 90, 10);
  Barrier7 [83] = new Barrier7 (1140, 450, 10, 180);
  Barrier7 [84] = new Barrier7 (900, 660, 10, 330);
  Barrier7 [85] = new Barrier7 (900, 660, 90, 10);
  Barrier7 [86] = new Barrier7 (960, 660, 10, 270);
  Barrier7 [87] = new Barrier7 (960, 750, 150, 10);
  Barrier7 [88] = new Barrier7 (1020, 810, 10, 180);
  Barrier7 [89] = new Barrier7 (900, 960, 150, 10);
  Barrier7 [90] = new Barrier7 (1020, 930, 150, 10);
  Barrier7 [91] = new Barrier7 (1080, 750, 10, 150);
  Barrier7 [92] = new Barrier7 (1080, 750, 90, 10);
  Barrier7 [93] = new Barrier7 (1140, 750, 10, 180);
  Barrier7 [94] = new Barrier7 (0, 0, 10, 330);
  Barrier7 [95] = new Barrier7 (0, 0, 90, 10);
  Barrier7 [96] = new Barrier7 (60, 0, 10, 270);
  Barrier7 [97] = new Barrier7 (60, 90, 150, 10);
  Barrier7 [98] = new Barrier7 (120, 150, 10, 180);
  Barrier7 [99] = new Barrier7 (0, 300, 150, 10);
  Barrier7 [100] = new Barrier7 (120, 270, 150, 10);
  Barrier7 [101] = new Barrier7 (180, 90, 10, 150);
  Barrier7 [102] = new Barrier7 (180, 120, 90, 10);
  Barrier7 [103] = new Barrier7 (240, 120, 10, 180);
  Barrier7 [104] = new Barrier7 (0, 330, 10, 330);
  Barrier7 [105] = new Barrier7 (0, 330, 90, 10);
  Barrier7 [106] = new Barrier7 (60, 330, 10, 270);
  Barrier7 [107] = new Barrier7 (60, 420, 150, 10);
  Barrier7 [108] = new Barrier7 (120, 480, 10, 180);
  Barrier7 [109] = new Barrier7 (0, 630, 150, 10);
  Barrier7 [110] = new Barrier7 (120, 600, 150, 10);
  Barrier7 [111] = new Barrier7 (180, 420, 10, 150);
  Barrier7 [112] = new Barrier7 (180, 450, 90, 10);
  Barrier7 [113] = new Barrier7 (240, 450, 10, 180);
  Barrier7 [114] = new Barrier7 (0, 660, 10, 330);
  Barrier7 [115] = new Barrier7 (0, 660, 90, 10);
  Barrier7 [116] = new Barrier7 (60, 660, 10, 270);
  Barrier7 [117] = new Barrier7 (60, 750, 150, 10);
  Barrier7 [118] = new Barrier7 (120, 810, 10, 180);
  Barrier7 [119] = new Barrier7 (0, 960, 150, 10);
  Barrier7 [120] = new Barrier7 (120, 930, 150, 10);
  Barrier7 [121] = new Barrier7 (180, 750, 10, 150);
  Barrier7 [122] = new Barrier7 (180, 750, 90, 10);
  Barrier7 [123] = new Barrier7 (240, 750, 10, 180);
  Barrier7 [124] = new Barrier7 (1200, 0, 10, 330);
  Barrier7 [125] = new Barrier7 (1200, 0, 90, 10);
  Barrier7 [126] = new Barrier7 (1260, 0, 10, 270);
  Barrier7 [127] = new Barrier7 (1260, 90, 150, 10);
  Barrier7 [128] = new Barrier7 (1320, 150, 10, 180);
  Barrier7 [129] = new Barrier7 (1200, 300, 150, 10);
  Barrier7 [130] = new Barrier7 (1320, 270, 150, 10);
  Barrier7 [131] = new Barrier7 (1380, 90, 10, 150);
  Barrier7 [132] = new Barrier7 (1380, 120, 90, 10);
  Barrier7 [133] = new Barrier7 (1440, 120, 10, 180);
  Barrier7 [134] = new Barrier7 (1200, 330, 10, 330);
  Barrier7 [135] = new Barrier7 (1200, 330, 90, 10);
  Barrier7 [136] = new Barrier7 (1260, 330, 10, 270);
  Barrier7 [137] = new Barrier7 (1260, 420, 150, 10);
  Barrier7 [138] = new Barrier7 (1320, 480, 10, 180);
  Barrier7 [139] = new Barrier7 (1200, 630, 150, 10);
  Barrier7 [140] = new Barrier7 (1320, 600, 150, 10);
  Barrier7 [141] = new Barrier7 (1380, 420, 10, 150);
  Barrier7 [142] = new Barrier7 (1380, 450, 90, 10);
  Barrier7 [143] = new Barrier7 (1440, 450, 10, 180);
  Barrier7 [144] = new Barrier7 (1200, 660, 10, 330);
  Barrier7 [145] = new Barrier7 (1200, 660, 90, 10);
  Barrier7 [146] = new Barrier7 (1260, 660, 10, 270);
  Barrier7 [147] = new Barrier7 (1260, 750, 150, 10);
  Barrier7 [148] = new Barrier7 (1320, 810, 10, 180);
  Barrier7 [149] = new Barrier7 (1200, 960, 150, 10);
  Barrier7 [150] = new Barrier7 (1320, 930, 150, 10);
  Barrier7 [151] = new Barrier7 (1380, 750, 10, 150);
  Barrier7 [152] = new Barrier7 (1380, 750, 90, 10);
  Barrier7 [153] = new Barrier7 (1440, 750, 10, 180);

  ///Maze 8///

  Barrier8 = new Barrier8 [46];
  Barrier8 [0] = new Barrier8 (0, 0, 1350, 30);
  Barrier8 [1] = new Barrier8 (0, 0, 30, 750);
  Barrier8 [2] = new Barrier8 (60, 0, 30, 750);
  Barrier8 [3] = new Barrier8 (0, 60, 1350, 30);
  Barrier8 [4] = new Barrier8 (0, 120, 1350, 30);
  Barrier8 [5] = new Barrier8 (0, 180, 1350, 30);
  Barrier8 [6] = new Barrier8 (0, 240, 1350, 30);
  Barrier8 [7] = new Barrier8 (0, 300, 1350, 30);
  Barrier8 [8] = new Barrier8 (0, 360, 1350, 30);
  Barrier8 [9] = new Barrier8 (0, 420, 1350, 30);
  Barrier8 [10] = new Barrier8 (0, 480, 1350, 30);
  Barrier8 [11] = new Barrier8 (0, 540, 1350, 30);
  Barrier8 [12] = new Barrier8 (0, 600, 1350, 30);
  Barrier8 [13] = new Barrier8 (0, 660, 1350, 30);
  Barrier8 [14] = new Barrier8 (0, 720, 1350, 30);
  Barrier8 [15] = new Barrier8 (0, 780, 1350, 30);
  Barrier8 [16] = new Barrier8 (0, 840, 1350, 30);
  Barrier8 [17] = new Barrier8 (0, 900, 1350, 30);
  Barrier8 [18] = new Barrier8 (0, 960, 1350, 30);
  Barrier8 [19] = new Barrier8 (0, 1020, 1350, 30);
  Barrier8 [20] = new Barrier8 (0, 1080, 1350, 30);
  Barrier8 [21] = new Barrier8 (0, 1140, 1350, 30);
  Barrier8 [22] = new Barrier8 (0, 1200, 1350, 30);
  Barrier8 [23] = new Barrier8 (0, 1260, 1350, 30);
  Barrier8 [24] = new Barrier8 (0, 1320, 1350, 30);
  Barrier8 [25] = new Barrier8 (120, 0, 30, 750);
  Barrier8 [26] = new Barrier8 (180, 0, 30, 750);
  Barrier8 [27] = new Barrier8 (240, 0, 30, 750);
  Barrier8 [28] = new Barrier8 (300, 0, 30, 750);
  Barrier8 [29] = new Barrier8 (360, 0, 30, 750);
  Barrier8 [30] = new Barrier8 (420, 0, 30, 750);
  Barrier8 [31] = new Barrier8 (480, 0, 30, 750);
  Barrier8 [32] = new Barrier8 (540, 0, 30, 750);
  Barrier8 [33] = new Barrier8 (600, 0, 30, 750);
  Barrier8 [34] = new Barrier8 (660, 0, 30, 750);
  Barrier8 [35] = new Barrier8 (720, 0, 30, 750);
  Barrier8 [36] = new Barrier8 (780, 0, 30, 750);
  Barrier8 [37] = new Barrier8 (840, 0, 30, 750);
  Barrier8 [38] = new Barrier8 (900, 0, 30, 750);
  Barrier8 [39] = new Barrier8 (960, 0, 30, 750);
  Barrier8 [40] = new Barrier8 (1020, 0, 30, 750);
  Barrier8 [41] = new Barrier8 (1080, 0, 30, 750);
  Barrier8 [42] = new Barrier8 (1140, 0, 30, 750);
  Barrier8 [43] = new Barrier8 (1200, 0, 30, 750);
  Barrier8 [44] = new Barrier8 (1260, 0, 30, 750);
  Barrier8 [45] = new Barrier8 (1320, 0, 30, 750);

  ///Maze 9///

  Barrier9 = new Barrier9 [127];
  Barrier9 [0] = new Barrier9 (0, 0, 90, 90);
  Barrier9 [1] = new Barrier9 (0, 0, 30, 150);
  Barrier9 [2] = new Barrier9 (60, 0, 30, 90);
  Barrier9 [3] = new Barrier9 (0, 120, 150, 30);
  Barrier9 [4] = new Barrier9 (120, 0, 30, 150);
  Barrier9 [5] = new Barrier9 (240, 0, 30, 150);
  Barrier9 [6] = new Barrier9 (240, 0, 270, 30);
  Barrier9 [7] = new Barrier9 (240, 120, 270, 30);
  Barrier9 [8] = new Barrier9 (300, 0, 30, 60);
  Barrier9 [9] = new Barrier9 (300, 90, 30, 60);
  Barrier9 [10] = new Barrier9 (360, 0, 30, 90);
  Barrier9 [11] = new Barrier9 (420, 0, 30, 90);
  Barrier9 [12] = new Barrier9 (480, 0, 30, 150);
  Barrier9 [13] = new Barrier9 (480, 0, 30, 150);
  Barrier9 [14] = new Barrier9 (600, 0, 30, 150);
  Barrier9 [15] = new Barrier9 (600, 0, 270, 30);
  Barrier9 [16] = new Barrier9 (600, 120, 270, 30);
  Barrier9 [17] = new Barrier9 (660, 0, 30, 60);
  Barrier9 [18] = new Barrier9 (660, 90, 30, 60);
  Barrier9 [19] = new Barrier9 (720, 0, 30, 90);
  Barrier9 [20] = new Barrier9 (780, 0, 30, 90);
  Barrier9 [21] = new Barrier9 (840, 0, 30, 150);
  Barrier9 [22] = new Barrier9 (840, 0, 30, 150);
  Barrier9 [23] = new Barrier9 (960, 0, 30, 150);
  Barrier9 [24] = new Barrier9 (960, 0, 270, 30);
  Barrier9 [25] = new Barrier9 (960, 120, 270, 30);
  Barrier9 [26] = new Barrier9 (1020, 0, 30, 60);
  Barrier9 [27] = new Barrier9 (1020, 90, 30, 60);
  Barrier9 [28] = new Barrier9 (1080, 0, 30, 90);
  Barrier9 [29] = new Barrier9 (1140, 0, 30, 90);
  Barrier9 [30] = new Barrier9 (1200, 0, 30, 150);
  Barrier9 [31] = new Barrier9 (300, 210, 30, 150);
  Barrier9 [32] = new Barrier9 (300, 210, 270, 30);
  Barrier9 [33] = new Barrier9 (300, 330, 270, 30);
  Barrier9 [34] = new Barrier9 (360, 210, 30, 60);
  Barrier9 [35] = new Barrier9 (360, 300, 30, 60);
  Barrier9 [36] = new Barrier9 (420, 210, 30, 90);
  Barrier9 [37] = new Barrier9 (480, 210, 30, 90);
  Barrier9 [38] = new Barrier9 (540, 210, 30, 150);
  Barrier9 [39] = new Barrier9 (660, 210, 30, 150);
  Barrier9 [40] = new Barrier9 (660, 210, 270, 30);
  Barrier9 [41] = new Barrier9 (660, 330, 270, 30);
  Barrier9 [42] = new Barrier9 (720, 210, 30, 60);
  Barrier9 [43] = new Barrier9 (720, 300, 30, 60);
  Barrier9 [44] = new Barrier9 (780, 210, 30, 90);
  Barrier9 [45] = new Barrier9 (840, 210, 30, 90);
  Barrier9 [46] = new Barrier9 (900, 210, 30, 150);
  Barrier9 [47] = new Barrier9 (1020, 210, 30, 150);
  Barrier9 [48] = new Barrier9 (1020, 210, 270, 30);
  Barrier9 [49] = new Barrier9 (1020, 330, 270, 30);
  Barrier9 [50] = new Barrier9 (1080, 210, 30, 60);
  Barrier9 [51] = new Barrier9 (1080, 300, 30, 60);
  Barrier9 [52] = new Barrier9 (1140, 210, 30, 90);
  Barrier9 [53] = new Barrier9 (1200, 210, 30, 90);
  Barrier9 [54] = new Barrier9 (1260, 210, 30, 150);
  Barrier9 [55] = new Barrier9 (150, 420, 30, 150);
  Barrier9 [56] = new Barrier9 (150, 420, 270, 30);
  Barrier9 [57] = new Barrier9 (150, 540, 270, 30);
  Barrier9 [58] = new Barrier9 (210, 420, 30, 60);
  Barrier9 [59] = new Barrier9 (210, 510, 30, 60);
  Barrier9 [60] = new Barrier9 (270, 420, 30, 90);
  Barrier9 [61] = new Barrier9 (330, 420, 30, 90);
  Barrier9 [62] = new Barrier9 (390, 420, 30, 150);
  Barrier9 [63] = new Barrier9 (510, 420, 30, 150);
  Barrier9 [64] = new Barrier9 (510, 420, 270, 30);
  Barrier9 [65] = new Barrier9 (510, 540, 270, 30);
  Barrier9 [66] = new Barrier9 (570, 420, 30, 60);
  Barrier9 [67] = new Barrier9 (570, 510, 30, 60);
  Barrier9 [68] = new Barrier9 (630, 420, 30, 90);
  Barrier9 [69] = new Barrier9 (690, 420, 30, 90);
  Barrier9 [70] = new Barrier9 (750, 420, 30, 150);
  Barrier9 [71] = new Barrier9 (870, 420, 30, 150);
  Barrier9 [72] = new Barrier9 (870, 420, 270, 30);
  Barrier9 [73] = new Barrier9 (870, 540, 270, 30);
  Barrier9 [74] = new Barrier9 (930, 420, 30, 60);
  Barrier9 [75] = new Barrier9 (930, 510, 30, 60);
  Barrier9 [76] = new Barrier9 (990, 420, 30, 90);
  Barrier9 [77] = new Barrier9 (1050, 420, 30, 90);
  Barrier9 [78] = new Barrier9 (1110, 420, 30, 150);
  Barrier9 [79] = new Barrier9 (-60, 210, 30, 150);
  Barrier9 [80] = new Barrier9 (-60, 210, 270, 30);
  Barrier9 [81] = new Barrier9 (-60, 330, 270, 30);
  Barrier9 [82] = new Barrier9 (0, 210, 30, 60);
  Barrier9 [83] = new Barrier9 (0, 300, 30, 60);
  Barrier9 [84] = new Barrier9 (60, 210, 30, 90);
  Barrier9 [85] = new Barrier9 (120, 210, 30, 90);
  Barrier9 [86] = new Barrier9 (180, 210, 30, 150);
  Barrier9 [87] = new Barrier9 (-120, 210, 30, 150);
  Barrier9 [88] = new Barrier9 (-120, 210, 270, 30);
  Barrier9 [89] = new Barrier9 (-120, 330, 270, 30);
  Barrier9 [90] = new Barrier9 (-60, 210, 30, 60);
  Barrier9 [91] = new Barrier9 (-60, 300, 30, 60);
  Barrier9 [92] = new Barrier9 (0, 210, 30, 90);
  Barrier9 [93] = new Barrier9 (60, 210, 30, 90);
  Barrier9 [94] = new Barrier9 (120, 210, 30, 150);
  Barrier9 [95] = new Barrier9 (90, 630, 30, 150);
  Barrier9 [96] = new Barrier9 (90, 630, 270, 30);
  Barrier9 [97] = new Barrier9 (90, 750, 270, 30);
  Barrier9 [98] = new Barrier9 (150, 630, 30, 60);
  Barrier9 [99] = new Barrier9 (150, 720, 30, 60);
  Barrier9 [100] = new Barrier9 (210, 630, 30, 90);
  Barrier9 [101] = new Barrier9 (270, 630, 30, 90);
  Barrier9 [102] = new Barrier9 (330, 630, 30, 150);
  Barrier9 [103] = new Barrier9 (450, 630, 30, 150);
  Barrier9 [104] = new Barrier9 (450, 630, 270, 30);
  Barrier9 [105] = new Barrier9 (450, 750, 270, 30);
  Barrier9 [106] = new Barrier9 (510, 630, 30, 60);
  Barrier9 [107] = new Barrier9 (510, 720, 30, 60);
  Barrier9 [108] = new Barrier9 (570, 630, 30, 90);
  Barrier9 [109] = new Barrier9 (630, 630, 30, 90);
  Barrier9 [110] = new Barrier9 (690, 630, 30, 150);
  Barrier9 [111] = new Barrier9 (810, 630, 30, 150);
  Barrier9 [112] = new Barrier9 (810, 630, 270, 30);
  Barrier9 [113] = new Barrier9 (810, 750, 270, 30);
  Barrier9 [114] = new Barrier9 (870, 630, 30, 60);
  Barrier9 [115] = new Barrier9 (870, 720, 30, 60);
  Barrier9 [116] = new Barrier9 (930, 630, 30, 90);
  Barrier9 [117] = new Barrier9 (990, 630, 30, 90);
  Barrier9 [118] = new Barrier9 (1050, 630, 30, 150); 
  Barrier9 [119] = new Barrier9 (1170, 630, 30, 150);
  Barrier9 [120] = new Barrier9 (1170, 630, 270, 30);
  Barrier9 [121] = new Barrier9 (1170, 750, 270, 30);
  Barrier9 [122] = new Barrier9 (1230, 630, 30, 60);
  Barrier9 [123] = new Barrier9 (1230, 720, 30, 60);
  Barrier9 [124] = new Barrier9 (1290, 630, 30, 90);
  Barrier9 [125] = new Barrier9 (1350, 630, 30, 90);
  Barrier9 [126] = new Barrier9 (1410, 630, 30, 150);
}

void draw()
{
  printArray(sensorValues);

  updateSerial();

  if (keyPressed == true)
  {
    /// Maze 1 ///

    if (key == '1')
    {
      updateSerial();
      background (#00D7FF);
      player1.draw();
      player1.move1(Barrier1);
      for (int i = 0; i < Barrier1.length; i ++)
      {
        Barrier1 [i].draw();
      }
    }

    /// Maze 2 ///

    if (key == '2')
    {
      updateSerial();

      background (#FF0088);
      player1.draw();
      player1.move2(Barrier2);
      for (int i = 0; i < Barrier2.length; i ++)
      {
        Barrier2 [i].draw();
      }
    }

    /// Maze 3///

    if (key == '3')
    {
      updateSerial();

      background (#FF9100);
      player1.draw();
      player1.move3(Barrier3);
      for (int i = 0; i < Barrier3.length; i ++)
      {
        Barrier3 [i].draw();
      }
    }

    /// Maze 4///

    if (key == '4')
    {
      updateSerial();

      background (#FF0000);
      player1.draw();
      player1.move4(Barrier4);
      for (int i = 0; i < Barrier4.length; i ++)
      {
        Barrier4 [i].draw();
      }
    }

    /// Maze 5 ///

    if (key == '5')
    {
      updateSerial();

      background (#00FF0E);
      player1.draw();
      player1.move5(Barrier5);
      for (int i = 0; i < Barrier5.length; i ++)
      {
        Barrier5 [i].draw();
      }
    }

    /// Maze 6 ///

    if (key == '6')
    {
      updateSerial();

      background (#FFF700);
      for (int i = 0; i < Barrier6.length; i ++)
      {
        Barrier6 [i].draw();
      }
      player1.draw();
      player1.move6(Barrier6);
    }

    /// Maze 7 ///

    if (key == '7')
    {
      updateSerial();

      background (#02F06B);
      for (int i = 0; i < Barrier7.length; i ++)
      {
        Barrier7 [i].draw();
      }
      player1.draw();
      player1.move7(Barrier7);
    }

    /// Maze 8 ///

    if (key == '8')
    {
      updateSerial();

      background (#BCBCBC);
      player1.draw();
      player1.move8(Barrier8);
      for (int i = 0; i < Barrier8.length; i ++)
      {
        Barrier8 [i].draw();
      }
    }

    /// Maze 9 ///

    if (key == '9')
    {
      updateSerial();
      background (255);
      player1.move9(Barrier9);
      for (int i = 0; i < Barrier9.length; i ++)
      {
        Barrier9 [i].draw();
      }
      player1.draw();
    }

    if (key == '0')
    {
      titleScreen();
    }
  }

  delay(100);
}

class ball1
{
  float x;
  float y;
  ball1 (float xx, float yy)
  {
    x = xx;
    y = yy;
  }

  void draw()
  {
    fill(#B9B9B9);
    ellipse(x, y, 10, 10);
  }

  void move1 (Barrier1 [] Barrier1)
  {
    float allowedX = x;
    float allowedY = y;

    if (sensorValues[3] > 100)
    { 
      allowedX= allowedX - 5;
    } 
    if (sensorValues[1] > 100) 
    { 
      allowedX = allowedX + 5;
    } 
    if (sensorValues[0] > 100)
    { 
      allowedY = allowedY - 5;
    } 
    if (sensorValues[2] > 100) 
    { 
      allowedY = allowedY + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier1.length; i++)
    {
      if (allowedX > Barrier1[i].x && allowedX < (Barrier1[i].x + Barrier1[i].w) && allowedY > Barrier1[i].y && allowedY < Barrier1[i].y + Barrier1[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == false)
    {
      x = allowedX;
      y = allowedY;
    }

    if (Collided == true)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move2 (Barrier2 [] Barrier2)
  {
    float allowedXX = x;
    float allowedYY = y;

    if (sensorValues[3] > 100)
    { 
      allowedXX= allowedXX - 5;
    } 
    if (sensorValues[2] > 100) 
    { 
      allowedXX = allowedXX + 5;
    } 
    if (sensorValues[1] > 100)
    { 
      allowedYY = allowedYY - 5;
    } 
    if (sensorValues[0] > 100) 
    { 
      allowedYY = allowedYY + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier2.length; i++)
    {
      if (allowedXX > Barrier2[i].x && allowedXX < (Barrier2[i].x + Barrier2[i].w) && allowedYY > Barrier2[i].y && allowedYY < Barrier2[i].y + Barrier2[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == false)
    {
      x = allowedXX;
      y = allowedYY;
    }
    if (Collided == true)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move3 (Barrier3 [] Barrier3)
  {
    float allowedX3 = x;
    float allowedY3 = y;

    if (sensorValues[0] > 100)
    { 
      allowedX3 = allowedX3 - 5;
    } 
    if (sensorValues[1] > 100) 
    { 
      allowedX3 = allowedX3 + 5;
    } 
    if (sensorValues[2] > 100)
    { 
      allowedY3 = allowedY3 - 5;
    } 
    if (sensorValues[3] > 100) 
    { 
      allowedY3 = allowedY3 + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier3.length; i++)
    {
      if (allowedX3 > Barrier3[i].x && allowedX3 < (Barrier3[i].x + Barrier3[i].w) && allowedY3 > Barrier3[i].y && allowedY3 < Barrier3[i].y + Barrier3[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == false)
    {
      x = allowedX3;
      y = allowedY3;
    }

    if (Collided == true)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move4 (Barrier4 [] Barrier4)
  {
    float allowedX4 = x;
    float allowedY4 = y;

    if (sensorValues[3] > 100)
    { 
      allowedX4 = allowedX4 - 5;
    } 
    if (sensorValues[1] > 100) 
    { 
      allowedX4 = allowedX4 + 5;
    } 
    if (sensorValues[0] > 100)
    { 
      allowedY4 = allowedY4 - 5;
    } 
    if (sensorValues[2] > 100) 
    { 
      allowedY4 = allowedY4 + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier4.length; i++)
    {
      if (allowedX4 > Barrier4[i].x && allowedX4 < (Barrier4[i].x + Barrier4[i].w) && allowedY4 > Barrier4[i].y && allowedY4 < Barrier4[i].y + Barrier4[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == false)
    {
      x = allowedX4;
      y = allowedY4;
    }

    if (Collided == true)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move5 (Barrier5 [] Barrier5)
  {
    float allowedX5 = x;
    float allowedY5 = y;

    if (sensorValues[2] > 100)
    { 
      allowedX5 = allowedX5 - 5;
    } 
    if (sensorValues[0] > 100) 
    { 
      allowedX5 = allowedX5 + 5;
    } 
    if (sensorValues[1] > 100)
    { 
      allowedY5 = allowedY5 - 5;
    } 
    if (sensorValues[3] > 100) 
    { 
      allowedY5 = allowedY5 + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier5.length; i++)
    {
      if (allowedX5 > Barrier5[i].x && allowedX5 < (Barrier5[i].x + Barrier5[i].w) && allowedY5 > Barrier5[i].y && allowedY5 < Barrier5[i].y + Barrier5[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == false)
    {
      x = allowedX5;
      y = allowedY5;
    }
    if (Collided == true)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move6 (Barrier6 [] Barrier6)
  {
    float allowedX6 = x;
    float allowedY6 = y;

    if (sensorValues[3] > 100)
    { 
      allowedX6 = allowedX6 - 5;
    } 
    if (sensorValues[1] > 100) 
    { 
      allowedX6 = allowedX6 + 5;
    } 
    if (sensorValues[0] > 100)
    { 
      allowedY6 = allowedY6 - 5;
    } 
    if (sensorValues[2] > 100) 
    { 
      allowedY6 = allowedY6 + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier6.length; i++)
    {
      if (allowedX6 > Barrier6[i].x && allowedX6 < (Barrier6[i].x + Barrier6[i].w) && allowedY6 > Barrier6[i].y && allowedY6 < Barrier6[i].y + Barrier6[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == true)
    {
      x = allowedX6;
      y = allowedY6;
    }

    if (Collided == false)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move7 (Barrier7 [] Barrier7)
  {
    float allowedX7 = x;
    float allowedY7 = y;

    if (sensorValues[1] > 100)
    { 
      allowedX7 = allowedX7 - 5;
    } 
    if (sensorValues[3] > 100) 
    { 
      allowedX7 = allowedX7 + 5;
    } 
    if (sensorValues[2] > 100)
    { 
      allowedY7 = allowedY7 - 5;
    } 
    if (sensorValues[0] > 100) 
    { 
      allowedY7 = allowedY7 + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier7.length; i++)
    {
      if (allowedX7 > Barrier7[i].x && allowedX7 < (Barrier7[i].x + Barrier7[i].w) && allowedY7 > Barrier7[i].y && allowedY7 < Barrier7[i].y + Barrier7[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == false)
    {
      x = allowedX7;
      y = allowedY7;
    }

    if (Collided == true)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move8 (Barrier8 [] Barrier8)
  {
    float allowedX8 = x;
    float allowedY8 = y;

    if (sensorValues[2] > 100)
    { 
      allowedX8 = allowedX8 - 5;
    } 
    if (sensorValues[0] > 100) 
    { 
      allowedX8 = allowedX8 + 5;
    } 
    if (sensorValues[1] > 100)
    { 
      allowedY8 = allowedY8 - 5;
    } 
    if (sensorValues[3] > 100) 
    { 
      allowedY8 = allowedY8 + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier8.length; i++)
    {
      if (allowedX8 > Barrier8[i].x && allowedX8 < (Barrier8[i].x + Barrier8[i].w) && allowedY8 > Barrier8[i].y && allowedY8 < Barrier8[i].y + Barrier8[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == false)
    {
      x = allowedX8;
      y = allowedY8;
    }

    if (Collided == true)
    {
      player1 = new ball1 (50, 50);
    }
  }

  void move9 (Barrier9 [] Barrier9)
  {
    float allowedX9 = x;
    float allowedY9 = y;

    if (sensorValues[0] > 100)
    {
      allowedX9 = allowedX9 - 5;
    } 
    if (sensorValues[2] > 100) 
    { 
      allowedX9 = allowedX9 + 5;
    } 
    if (sensorValues[3] > 100)
    { 
      allowedY9 = allowedY9 - 5;
    } 
    if (sensorValues[1] > 100) 
    { 
      allowedY9 = allowedY9 + 5;
    }

    boolean Collided = false;
    for (int i = 0; i < Barrier9.length; i++)
    {
      if (allowedX9 > Barrier9[i].x && allowedX9 < (Barrier9[i].x + Barrier9[i].w) && allowedY9 > Barrier9[i].y && allowedY9 < Barrier9[i].y + Barrier9[i].h)
      {
        Collided = true;
      }
    }

    if (Collided == true)
    {
      x = allowedX9;
      y = allowedY9;
    }

    if (Collided == false)
    {
      player1 = new ball1 (50, 50);
    }
  }
}

class Barrier1
{
  float x;
  float y;
  float w;
  float h;

  Barrier1(float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(255);
    rect (x, y, w, h);
  }
}

class Barrier2
{
  float x;
  float y;
  float w;
  float h;

  Barrier2(float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(255);
    rect (x, y, w, h);
  }
}

class Barrier3
{
  float x;
  float y;
  float w;
  float h;

  Barrier3 (float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(255);
    rect (x, y, w, h);
  }
}

class Barrier4
{
  float x;
  float y;
  float w;
  float h;

  Barrier4 (float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(255);
    rect (x, y, w, h);
  }
}

class Barrier5
{
  float x;
  float y;
  float w;
  float h;

  Barrier5 (float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(255);
    rect (x, y, w, h);
  }
}

class Barrier6
{
  float x;
  float y;
  float w;
  float h;

  Barrier6 (float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    fill(255);
    ellipse (x, y, w, h);
  }
}

class Barrier7
{
  float x;
  float y;
  float w;
  float h;

  Barrier7(float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(#537662);
    rect (x, y, w, h);
  }
}

class Barrier8
{
  float x;
  float y;
  float w;
  float h;

  Barrier8(float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(255);
    rect (x, y, w, h);
  }
}

class Barrier9
{
  float x;
  float y;
  float w;
  float h;

  Barrier9(float xx, float yy, float ww, float hh)
  {
    x = xx;
    y = yy;
    w = ww;
    h = hh;
  }

  void draw()
  {
    noStroke();
    fill(#013E33);
    rect (x, y, w, h);
  }
}

void setupSerial()
{
  printArray(Serial.list());

  myPort = new Serial(this, "COM5", 9600);

  myPort.clear();

  myString = myPort.readStringUntil( 10 );

  myString = null;

  sensorValues = new int[NUM_OF_VALUES];
}

void titleScreen()
{
  background(0);

  delay(500);

  fill(#FEFF00);
  ellipse(width/2, height/3, 240, 240);

  noStroke();
  fill(0);
  arc(675, 250, 170, 170, 0, PI);

  fill(255);
  rect(660, 251, 25, 35);

  noStroke();
  fill(0);
  ellipse(575, 250, 20, 20);
  ellipse(775, 250, 20, 20);

  noStroke();
  fill(#FEFF00);
  arc(575, 250, 25, 25, 0, PI/3.5);
  arc(775, 250, 25, 25, 0, PI/3.5);

  delay(1000);

  fill(#FF0000);
  font1 = createFont("Serif", 32);
  textFont(font1);
  textAlign(CENTER);
  text("Into the Belly of the Beast", width/2, height/1.75);

  fill(255);
  font2 = createFont("Serif", 25);
  textFont(font2);
  textAlign(CENTER);
  text("One of PacMan's fallen pellets, Pelle, refuses to stay victim of PacMan's regime.", width/2, height/1.50); 
  text("For far too long, PacMan has taken advantage of his power.", width/2, height/1.40);
  text("Now, it is your turn to show PacMan your power!", width/2, height/1.30);
  text("By pressing and holding the number keys, cycle through PacMan's tricky 9 stomachs and help Pelle escape.", width/2, height/1.20);
  text("Remember to reorient yourself to your new environments.", width/2, height/1.10);
}

void updateSerial() 
{
  while (myPort.available() > 0) 
  {
    myString = myPort.readStringUntil( 10 ); 

    if (myString != null) 
    {
      String[] serialInArray = split(trim(myString), ",");

      if (serialInArray.length == NUM_OF_VALUES) 
      {
        for (int i=0; i<serialInArray.length; i++) 
        {
          sensorValues[i] = int(serialInArray[i]);
        }
      }
    }
  }
}

[ARDUINO]
void setup() 
{
  Serial.begin(9600);
}

void loop() {
  int Top = analogRead(A0)/4;
  int Right = analogRead(A1)/4;
  int Bottom = analogRead(A4)/4;
  int Left = analogRead(A5)/4;

  Serial.print(Top);
  Serial.print(","); 
  Serial.print(Right);
  Serial.print(",");
  Serial.print(Bottom);
  Serial.print(",");
  Serial.print(Left);
  Serial.println(); 
  // too fast communication might cause some latency in Processing
  // this delay resolves the issue.
  delay(100);
}

Recitation 4: Animation in Processing (Rudi)

Skye Gao

professor Rudi

Recitation 4: Animation in Processing

Step 1: Choosing image

The image I referred to was from Bauhaus School of Arts, The link is below and The image looks like this.

T1

László Moholy-Nagy, T1, 1926. Oil, sprayed paint, incised lines, and paper on Trolit, 55 1/16 x 24 5/16 inches (139.8 x 61.8 cm)

Step 2:

inspired by the image, I wanted to imitate the elements in the picture and make a animation effect of them. So I drew the ellipses, line, and the cross just as the picture and make the white ellipse and the yellow cross rotate along the line and the two ellipse blinking at the same time. I used functions like ellipse(), line(), rect(), framework (), popMAtrix(), pushMatrix(). The code are attached below.

Reflection:

  • What are the differences and similarities between the image you chose in Step 1 and the image you created in Step 2?
  • Do you think that drawing in Processing is different than drawing/painting by hand? How is it different? Why is it different?
  • Is there any value in recreating an existing image/drawing/graphic using computational media? What is it?
  • Do you think that both drawings cause the same feelings in the viewer?
  • If you were to create multiple variations of your drawing, what would these variations be and how would they differ?

Between the image I chose and the image I created, the similarities is the layout of the patterns, cause I just drew it according to the original painting. While the differences are: first, the exact look are not the same, because I was using a computer to draw, I cannot recreate the tactile appeal. Second, I made animation for my creation, let the patterns began to move.

I think drawing by hand is quite different. Personally speaking, I think pairing by hand relies more on the instinct and sense of control towards the pen and color. While painting by computer is more about calculating and programming. I think it is because the material used to paint are different, one is coating while the other are digital pixels.

I think the value of recreating an existing image/drawing/graphic using computational media maybe showing a dynamic way to present the artistic idea. Like I  did in my project, rather than static images, the patterns can move and rotate and blink, which definitely change the feeling in the viewers and thus present a different feelings.

I think for my own variable drawing, I may use the traditional way to compose the disc elements and use animation to make them change. Like changing the color filled into the shape, make the background fade, or make patterns move around the frame.

int c;
int x;
int y;
int m;
int n;
int u;

void setup() {
  size (1000, 300);
  background (#071A48); 
  frameRate(20);
}
void draw() {
  background (#071A48);

  //draw the white ball and change the gray degree of it
  pushMatrix();
  noStroke();
  //if (c>=100 && c<=200){
  //c=c+1;
  //} 
  //let white ball move along the line
  if (x<=400) {
    x = x + int(frameRate);
    y = y + int(frameRate);
  }
  c=round(random(100, 200));
  fill(c);
  ellipse (100+x, 150+y*3/20, 100, 100);
  popMatrix();

  //draw the yellow cross
  fill (#D1BA67);
  rectMode(CENTER);
  rect(140, 120, 10, 40);
  rect(140, 120, 40, 10);

  //draw the white line
  stroke(255);
  line(20, 188, 500, 260);

  // draw the yellow ellipse
  //pushMatrix();
  noStroke();
  if (m<=460 && m>=0) {
    m = m + int(frameRate);
    n = n + int(frameRate);
  } 
  fill (#D1BA67);
  ellipse(500-m, 230-n*3/20, 60, 60);
  //popMatrix();

  //draw the black ellipse
  noStroke();
  u=round(random(0, 100));
  fill (u);
  ellipse(800, 150, 200, 200);
  println (n);
}

Midterm

For my midterm I originally intended to use capacitive sensing in a menu like structure to start a game of snake. From there, I would ideally play the game but using capacitive sensing to control the movements of the snake. This turned out to be too much to ask. I couldn’t wrap my head around sending data that I could use from Arduino to Processing and I have later realized it was because I wasn’t using println so data would just keep on coming without a line to separate it and I (at the time) could not figure that out. At any rate, I did manage to make a snake game. I took a hard glance at code on the internet and realized that visualizing the code in terms of arrays was basically the key to thinking about it, both in terms of structure and code. Most games I saw online ended when the snake hit the side so I tried teleporting it.

As far as projects go, however, I felt like I underutilized my potential here. Working on the code for the snake was very easy as I found that I could use arrays very easily after handling lists last semester in python. A few commands were the same and their overall structure and just convenience allowed me to get done with the code fairly quick, albeit after looking at code online to kind of get a semblance on how to start and what things to keep in mind.

My takeaway would now be that failing at capacitive sensing at that point allowed me grow and learn from the mistakes I made and understand it better. I mean, I would have ideally like to have learned that before the project, but progress is progress. This project, however, was really my first time just consistently using processing every day and it allowed me to familiarize myself with it’s syntax and structure. I was just pleasantly surprised to see that I could relay some of my Python knowledge into this project.

This project was not completed by midterms, however, in a sense. I kept running into problems with the snake getting stuck at random points. It wasn’t until a week after that I realized I had to create a class (and at the time I had not worked with classes).

int gameWidth = 16;
int gameHeight = 16;
ArrayList<Segment> snake = new ArrayList<Segment>(); // arraylist of snake's x and y. We are basically announcing our intention to fill up arraylist snake with object segment.
float calibWidth;
float calibHeight; // Width and height of segments/food 
int headDir = RIGHT; // Direction of head
int xFood = int(gameWidth/2), yFood = int(gameHeight/2); // Coordinates of food
int headX, headY; // Coordinates of head (makes reading code easier)
int highScore; // Highscore (longest snake)

void setup() {
  size(512, 512); // Set window size
  noStroke(); // Don't outine squares
  fill(0); // Black snake/food
  frameRate(12); // Low fps
  calibHeight = height/gameHeight;
  calibWidth = width/gameWidth; // Define cell width/height
  print(snake);
  snake.add(new Segment(0, 0)); 
  print(snake);// Initialize snake
  textSize(16); // Set font size in pixels
}

void draw() {
  background(255); // White background
  rect(xFood*calibWidth, yFood*calibHeight, calibWidth, calibHeight); // Draw food
  headX = snake.get(0).x; // Set headX and headY
  headY = snake.get(0).y;
  for (int c = 1; c < snake.size(); c++) // Check all segments except head
    if (snake.get(c).x == headX && snake.get(c).y == headY) { // If the head has run into any other segment
      int tmpSize = snake.size(); // Set a temporary snake size
      for (int c2 = tmpSize-1; c2 > 0; c2--) // Remove all segments but the head
        snake.remove(c2);
    }
  if (keyPressed)
    if ((keyCode == UP && headDir != DOWN)|| (keyCode == LEFT && headDir != RIGHT) || (keyCode == DOWN&& headDir != UP) || (keyCode == RIGHT && headDir != LEFT)) // If WASD keyCode pressed and snake is not going backwards
      headDir = keyCode; // Set that to the direction
  switch(headDir) { // Add segment
  case UP: // If the head is going up
    snake.add(0, new Segment(headX, headY-1)); // Add a new segment above it
    if (snake.get(0).y == -1) // If the snake has gone out of the top
      snake.get(0).y = gameHeight-1; // Teleport it to the bottom
    break;
  case LEFT: // If the head is going left
    snake.add(0, new Segment(headX-1, headY)); // Add a new segment to its left
    if (snake.get(0).x == -1) // If the snake has gone out of the left side
      snake.get(0).x = gameWidth-1; // Teleport it to the right side
    break;
  case DOWN: // If the head is going down
    snake.add(0, new Segment(headX, headY+1)); // Add a new segment below it
    if (snake.get(0).y == gameHeight) // If the snake has gone out of the bottom
      snake.get(0).y = 0; // Teleport it to the top
    break;
  case RIGHT: // If the head is going right
    snake.add(0, new Segment(headX+1, headY)); // Add a new segment to its right
    if (snake.get(0).x == gameWidth) // If the snake has gone out of the right side
      snake.get(0).x = 0; // Teleport it to the left side
    break;
  }
  if (snake.get(0).x == xFood && snake.get(0).y == yFood) { // If snake reaches food
    snake.add(new Segment(xFood, yFood)); // Add another segment
    xFood = int(random(gameWidth)); // Move food to random place
    yFood = int(random(gameHeight));
  }
  snake.remove(snake.size()-1); // Remove tail of snake
  for (int c = 0; c < snake.size(); c=c+1)
    snake.get(c).update();// Draw snake
  if (snake.size() > highScore) // If there's a new highscore
    highScore = snake.size(); // Change the highscore to the new record
  text("Score: " + snake.size() + "nHighscore: " + highScore, 0, 16);
}

class Segment {
  int x, y; // Coordinates of segment
  Segment(int tmpX, int tmpY) { // Constructor function (initializes variables)
    x = tmpX;
    y = tmpY;
  }
  void update() {
    rect(x*calibWidth, y*calibHeight, calibWidth, calibHeight);
    
  print(x);
  print(y); // Draw the segment
  }
}