Project 9

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

The purpose of this lab was to create more realistic shapes by using classes. In this lab I was able to derive classes from other classes to create new shapes that are easy to call, and well organized.

Task one was to make a file and make a tree class that is derived from the shape class. I had to overide the shape init function so that the tree had the right parameters. Then I had to make a loop for the tree to draw in three places.

The next task was to make more shapes and derive them from the shape class. I made squares, triangles, rectangles all filled and unfilled and a plant pot to hold the trees. Then to make a picture I had to call each of the shapes by using the draw function.

The third task was to make an indoor scene with the shapes I created. Getting the shapes to align and be in the right places was the only problem but by using a scale I could make the picture. Also by using the tree class I could make two different trees with different iterations.

The fourth task was to create tiles with the different shapes. I created sqaures with triangles or sideways pots in them with different colors. By using a proper scale it was not hard to get the shapes to be in the right places.

I learned how to make classes and derive new classes from them, and also how to overide the init functions to make the shapes correct. I learned more about how to use the scale, and how to make more realistic trees. Also I learned that classes organize code in a more efficient way.