3B Thur Sept 20th

Due Tuesday Sept 20th.

PAIR PROGRAMMING

1) The Fuse

Fuse or Progress Bar (complete in class and post to openProcessing)
Make a fuse on screen that takes 5 seconds to complete its timer. Trigger an interesting event when it finishes eg. an explosion, fireworks etc. Think laterally, your fuse could be a progress bar, or an ice cube melting, a balloon inflating etc. etc. (See the function millis(); for measuring the amount of time since the sketch started. You might want to look into how to include an image in your sketch. Also see the first half if this tutorial on images. )

 

 

 

HOME WORK – GOOD TIMES WITH CONDITIONAL STATEMENTS AND BOOLEAN VARIABLES ?

1) Read chapter 5, doing exercises as you go (5.1-5.8). Save these on your local machines.

The following State Machine Exercises are not so visually exciting you do not need to put them onto OpenProcessing. Instead, when you have completed them, please zip them up name them with your name, and drop them into our direct message on SLACK. You may want to review this video on boolean variables.

2) State machine I

Place a white square on a grey background. Create an interaction where each click in the square flips its color. It should flip from white to black (if it is white), or from black to white (if it is black).

3) State machine II

Place a white square on a grey background. Create an interaction where two clicks in the square are required to turn it from white to black, but three clicks are required to turn it from black to white.

4)  State machine III

Place a white square on a grey background. Create an interaction where the square turns black only the mousebutton is down, AND the cursor is inside the square. If the cursor exits the area or the button is released, the square reverts to white. Does it feel better if the initial click is inside the square or anywhere in the frame.

5) State machine IV

Place a white square on a grey background. Turn the square into a button with a ‚”hover‚”” state: Make it white when inactive; Yellow when the user is hovering over it (mouseDown is false); Black when the user is holding the mouse down inside of it; and turn it back to white thereafter.