Project Title: Cheerful Jelly Bean
Link: https://editor.p5js.org/Lisa-HuangZijin/sketches/k5JzoN3Ii
Brief Description and Concept: I want to capture the dynamic beauty of rotating, make the jelly bean cute. And the lines that vary a lot are glowing sticks. The guy is trying to cheer up for you. Meanwhile, I tried eyes blinking this time.
Demo/Visual Documentation:
Coding Part: I think the part that costed a lot of time is that I need different parts of body move together, like a whole. So you can see each part of them share the same parameters to move accordingly.
Because I created the body with two circles and a rectangle, I use the parameter “length” to ensure that they won’t went apart when they are moving.
Another try I’ve made is the eye blinking. I made it by make two rectangles move. Because the rectangles share the similar color with the body, so the moving of them can be better viewed as eye lips instead of rectangles.
- What is the benefit of your class not relying on any code outside of its own definition?
Using class, the most obvious feature is that the “function draw” part is very clean and tidy. Besides, class makes different parts sharing the same parameters becomes possible, improve the efficiency when we are coding.
- What make it challenging to write code that has to harmonize with the code other people have written?
First, if other writes the translate, I need to figure out how I need to change my position so that my patterns will show in the right place. And different people tend to name the same part different names. Sometimes it cost me a lot of time to find the part of code or values I want.
- Describe the terms modularity and reusability using the example of your dancer class.
For modularity, I suppose I make it by display the same “draweys” with different parameters. In that case I get the same eyes but in different positions.
For reusability, I think I make it through applying the same parameters in different draw parts. Like I use “length” to draw the body, eyes, blinks, and sticks.