The basic programming code that I'll be using for the exhibition for Project 3 is the 'if/then/else' code. We have been asked to find Processing applications on openProcessing and study their use of statements. 
http://www.openprocessing.org/visuals/?visualID=7841
This is a sketch using alot of simple if/then statements. They have made it into a 'Choose your own adventure' story used in books like Goosebumps. They use the if statement to let the user choose between two options. They have used many pages and uses the if/else statement to navigate between them.
Code example: 
    if (overButton(b3x, b3y, b3w, b3h) == true) {
    }else if (page == 8) {
http://www.openprocessing.org/visuals/?visualID=23662
 
This is a sketch uses if/else statements to choose a flag from a set. They use the if/else by checking to see which subprocess to run. 'If select <2, then run "scandinavia", else run "flag" etc.. This person uses the code slightly differently to the last as they use it with a random number to check and run the right process, where the other is using it for changing screens based on users decisions.
Code:
 float select = random(14);
  if (select <2){ 
http://www.openprocessing.org/visuals/?visualID=26683 
This is a sketch using if statements to change the picture depending on where the mouse is. This is more similar to the first sketch than the last as the if/else statement is based around the users decision. This sketch changes the picture, lighting up a skyline of buildings judging on how far the users mouse is across the sketch. The if statement shows the picture based on the cursor.
Code:
 if ((mouseX > 0) && (mouseX<50)) {
    else if ((mouseX > 50) && (mouseX < 100)) { | 
 
No comments:
Post a Comment