https://editor.p5js.org/rl4800/sketches/_tmks3rzR
I drew a guitar dancer playing itself and dancing.
- What is the benefit of your class not relying on any code outside of its own definition?
When calling an object using class, it makes the whole program neat and clean. We can move the object to any position we want. And when changing the value, we would only change the value of the class, we won’t accidentally change other values.
- What makes it challenging to write code that has to harmonize with the code other people have written?
I can only call a new variable in the class code. Thus, I cannot use the function let as we do before.
Besides, I cannot change the framerate I want.
- Describe the terms modularity and reusability using the example of your dancer class.
My lines about “this.—” only make use of it in the class itself.
If we integrate all the objects in one sketch, we could call them as variables, and call them as many as we can.