Lingwu Li
a5f3bfcd8f749750138a6184173a364e.mp4
This week I built on last week’s doll sketch by adding variables so the doll can move: ·Eyes: I used variables tied to frameCount so both eyes shift position and move clockwise in a circle over time.
·Mouth: I linked the mouth’s size to the mouse position, so as the cursor moves across the screen the mouth opens and closes.
What’s interesting is that although the image seems to move on its own, every change is actually connected to something else. For example, the eyes’ circular motion is linked to the passage of time, while the mouth’s opening and closing depend on the mouse’s position. Similarly, many elements in the code are relative and interdependent: a position only makes sense in relation to the origin, and a variable’s value can only increase or decrease after it has been initialized.