Dancing Squidward

Here’s my code.

Bikini Bottom’s famous resident Squidward goes to CC Lab’s dance party alone to avoid his noisy neighbors. He is not good at dancing although he’s a great musician. So he is just moving around and shaking his arms to join this party. 

I was struggled with rotating Squiward’s arms since I forgot how to combine rotate() and translate(). 

When my class does not relying on any code outside of its own definition, I find it much easier to check my code when there are too many the objects needed to be created. I can simply list them first in my class instead of making them all over the place. 

It is challenging to write code that has to harmonize with the code other people have written because I need to avoid messing with other people’s code. I need to strictly control that my instructions only apply to my variables and properties.

In my code, I use class() to make my dancer a single module instead of mixing my dancer  in other’s code. Therefore, modularity can separate different modules to ensure that other parts are not contaminated. Besides, reusability can be implemented in this way: I only need to define Squidward’s arms and legs once, and then I can make multiple copies by changing individual variables.

Leave a Reply

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