Lab7 Class

You will add code to the setup() method to create an array of various Shapes and code to the draw() method which will display all of these Shapes each frame.


Note here that we are invoking the abstract draw method on each Shape, but Java is selecting the specific implementation to call from our Rectangle or Circle class at runtime.


Testing

In the Lab7's draw method, add the following line right before you draw each shape:

fill (i * 64);

Where i is the index of the Shape you are currently drawing.

The fill() method from PApplet chooses a color for each shape drawn (rect and ellipse in our case).

Depending on how you choose to initialize each shape, your window should look similar to: