For this week, the homework was to re-write the code of our original drawing to include certain things like:
- One element controlled by the mouse. (in my case, the color of the alien)
- One element that changes over time, independently of the mouse. (in my case, the eyes and mouth).
- One element that is different every time you run the sketch.(in my case, the background).
I have to admit that reverse engineering each step was a struggle and I had to use the "reference" page on p5.js several times and adapt the examples to what I wanted. Several times I could get to the answer by trial and error. I've found that using variables is much easier later on when I want to do more complicated things based on code already written. Writing with hard numbers is easier first but later on is a hassle when I have to re-write it.
Comments