Worksheet

https://docs.google.com/document/d/1KWR6ucWz68TaTDzPOyLvUVHqLSjUmkbsDM1PG6R38aA/edit?tab=t.0

https://docs.google.com/document/d/1KWR6ucWz68TaTDzPOyLvUVHqLSjUmkbsDM1PG6R38aA/edit?usp=sharing

Homework

https://editor.p5js.org/lwang62/sketches/ss3oSYQVM

image.png

I continued using last week's image for this week's assignment. I wanted the cat's eyes to follow the mouse cursor, so I looked up some references and used the map function. I also changed the color of the rice candy to a random color.

Q

  1. If I draw an image in p5js and want to reuse it many times, should I use a variable, or is there another way to do this?
  2. When we use ‘fill,’ we always specify RGB values, which allows us to fill with a specific color. Is there a way to fill with a gradient in p5js?