In this recitation, I attended the Object Oriented Programming workshop taught by Tristan. We learned how to organize our code to better control many objects. We followed his code to create a couple of “people” made of ellipses and strokes to move when their head was clicked. By using OOP, we were able to create many different versions of the people with a few lines of code.
I altered the example code by having the people interchange between moving horizontally and vertically when their heads were clicked. Katie helped me achieve this by showing me how to use the % syntax, so that when the divided remainder was even, the people would move vertically, and when the remainder was odd, they would move horizontally.
Overall code
Object Code