WEEK: 14

Extra Credit

In this assignment, you are to use the existing project from the previous week and extend it one more time. Create a class for a simple shape. Using the class, create at least 3 objects (instead of just two) and display them - look back at item 4 on the last homework.

Specifications

  1. Create a class.
  2. Create a constructor in the class.
  3. Create a function called “display” to display the shape.
  4. Pass the x, y, the size (height, width or diameter), and the color into the constructor.
  5. Create at least three different objects of different locations, sizes and colors.
  6. Call the display function in the draw of your main sketch.
  7. Upload your files to GitHub and turn your link into Canvas.

Want more?

  1. Store the objects in an array and display them.
  2. Check for collisions on the objects in the array.

Previous section: