OOP: rethinking imaginary creatures

     For this assignment I used OOP on my previous imaginary creature code. I created a class called Owl that creates an instance of the imaginary creature I made. Each owl object has a x and y position, angle and scale as instance variables. From those I created the constructor and the display() method that displays the owl. I also added a “spin” argument to the display function to cause the owl to spin on-screen. The display() function calls the methods owl_face and owl_wings in order to draw the final sketch.

 

 

     I am familiar with oop and I understand the benefits of using it to create the imaginary creature; it helps in creating unique, but standardized attributes that can be saved for each owl, and makes it easier to display each owl object rather than calling multiple functions. I was pleased with how easy the implementation of the class was. As all of the code is already there, it just needs to be organized into the OOP paradigm, but it shows how OOP can streamline and simplify dealing with and calling multiple functions. Retrofitting them as methods makes better cohesion and coherence. Even the syntax I was somewhat familiar with it, and it gave me some nostalgia for when I was studying OOP with java in my senior year of high school.

 

Leave a Reply

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