ICM 005
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
https://editor.p5js.org/MagicMonkeyWow/sketches/BF13bCaBO
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 for some references of the effects that I want to make, spent a lot of time comprehending 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.
https://editor.p5js.org/jm8988/sketches/IYsA2bowV
https://editor.p5js.org/jm8988/sketches/38odbSIzd
https://editor.p5js.org/jm8988/sketches/IYsA2bowV
I changed the sketch of Candy by using the array. Hoping it can be more interesting than the previous version.