intro.to COMputational Media

Class

Assignments

The idea this week is to explore reorganizing / refactoring your code. It is 100% legitimate to turn in a version of a previous assignment where nothing changes for the end user, but the code has been restructured. You may, however, choose to try a new experiment from scratch. Aim to keep setup() and draw() as clean as possible, and do everything (all calculations, drawing, etc.) in functions that you create yourself. Possibilities (choose one or more):

1. Break code out of setup() and draw() into functions.

2. Use a function to draw a complex design multiple times with different parameters.

3. Reorganize "groups of variables" into objects (see Video 2.3 mentioned above).

4. If you are feeling ambitious, try embedding a function into an object.

reference

I feel quite frustrated doing this week’s project. Because I thought, since I’ve already learned function, maybe I’m able to make some complicated patterns. I searched some references of the effects that I want to make, spent a lot of time to comprehend the logic in the sketches, but to find out they are still too difficult for me to understand all the code.

 

For this week’s work, I organized two sketches by using function, and reviewed the knowledge about p5js so far.

I changed the sketch of Candy by using array. Hoping it can be more interesting than the previous version.