Dancing creature

Link to projecthttps://editor.p5js.org/jiawen21/sketches/rucX-aSN0

Description: This is a dancing creature that changes color every time it is refreshed. Its feature is swaying the body back and forth.

Screen record of the dancing creature:Screen Recording 2022-10-24 at 10.07.16 PM

This part is the one I’m most proud of and the one that I spend the most time on. I struggled to make the dancing creature move and I had to do some research before getting the gist of how the sin and frame count and frequency work here.

Reflection:

The benefit of not relying on a code outside the class is that everything is in one place rather than all over the place. Class makes it easier so when people read the code, it’s much easier to understand. It’s sort of like a shortcut because you don’t need to write the same code multiple times. You can reuse the code as many times as you want.

The challenging part is that the code has to be unique from others. Also the idea of not knowing what kind of movement they will be coding. For example, will they be moving left to right or spinning?

Reusability helps us save a lot more time in coding because with modularity I used the same modules somewhere else in my code but slightly changed it to make it different. In my code I reused. For example, in the code sort of reused the left leg for the right leg but changed the rotation from X to Y. But the line values themselves were still the same. As for modularity, it means if one person draws a boundary on the code, that part of the code would still work and not be affected.

 

Leave a Reply

Your email address will not be published. Required fields are marked *