Monday, 9 May 2011

the if/else statement...........

This is the third code I have found in relation to the if/else statement on open processing called flesh light..... It is an interactive code that appears to be like metal being burnt with different colours or something like a lava lamp. There are heaps of if statements used through out the code and a few else statements..... they are used to change the appearance, the colour, speed and fluidity of the moving changeable shape.. This list that was accompanied with code shows just how many if statements the code contains
 Click the mouse to change colour
//Below are the controls
// if (key=='m')metal = !metal;
// if (key=='l')dolines = !dolines;
// if (key=='z')doellipses = !doellipses;
// if (key=='a')auto=!auto;
// if (key=='q')harukitmode = 1; //- TODO
// if (key=='w')harukitmode = 2; //- TODO
// if(key=='2')gmode=2;
// if(key=='3')gmode=3;
// if(key=='4')gmode=4;
// if(key=='5')gmode=5;
// if (key=='v')vnorm = !vnorm;
// if (key=='c')constant = !constant;
Although this code does rely heavily on interaction it does function on its own by the computer runs the code when an if statement comes true ie. if (key=='E'){exit();},
because the e button is pressed then the computer reads that it is suppose to exit the programme..... this code is similar to the second code in the interaction but there are independent events and therefore there are more singular if statements with out else statements.


                                          

No comments:

Post a Comment