The first time an if/else statement is used in this sketch is to designate when the original menu should be displayed, when a different menu should be displayed, or when the drawing function should be displayed.
The second time the if/else statement is used in this sketch is based on the drawing function of the sketch. In this case, the if designates what is drawn on the screen based on where the mouse is and which functions are set. Since there are many different controls for this program this statement is repeated in many different ways so that the program knows what to do when the spacebar is pressed or when arrows are pressed.
No comments:
Post a Comment