Variables and Conditions

 

From the last session
Beauty of abstract coding (short, effective)
cx = cx – 1;
cx — ;

cx  -= 1;

W2 GOAL

Create a sketch that includes (all of these)

  • 1 element controlled by the mouse : movement of the eye following the mouse position
  • 1 element that changes over time, independent of the mouse : color of the hair & movement of the eye brow & mouse
  • 1 element that is different every time you run the sketch : random color of the hair

Code

Eyeball following the mouse position

Eyebrow moving up and down

  • Use of multiplying by -1 to change the direction
  • Also have other way, using boolean

Wobbly lip