Conditionals
This week we learned to use conditionals (if statements) in our sketches. While I already experimented a bit with if statements in my sketch for week 2, I was able to grasp the concept much better this week. if...else if statements can be used to manipulate the sketch based on particular conditions. These conditions usually take the form of comparisons, which if true/satisfied, a block of code runs. And if false the block of code is skipped and other conditions are checked or the default case becomes true (if one is defined). I also like the increased possibilities that come from using if... else statements with && (AND), || (OR), and ! (NOT) operators.
The worksheet this week was a bit challenging. The second question had me scratching my head for quite a bit. But I did enjoy working out the logic on my own. I was especially proud of getting the slider widget to work without looking anything up.
Pair Sketch
For this week's sketch, we started with the idea of the user (person controlling the mouse) getting to experience something different (yet connected) in every quadrant of the canvas. We started by just drawing random shapes, then we connected them with a common variable that increases in some quadrants and decreases in some. But watching it transition was the most fun part. The canvas is reset when the mouse is clicked BUT the user can only start drawing again by clicking in the right quadrant. Click anywhere else and you'll go back to the messy sketch you wanted to reset.
Comments