Crop and animal graphical sub-classes

A cow

Now that we have a resource file and the CropGraphicsPixmapItem and AnimalGraphicsPixmapItem classes we can turn our attention to the individual crops and animals.

We will need to sub-class CropGraphicsPixmapItem to create:

  • WheatGraphicsPixmapItem
  • PotatoGraphicsPixmapItem

and we will need to sub-class AnimalGraphicsPixmapItem to create:

  • CowGraphicsPixmapItem
  • SheepGraphicsPixmapItem

Doing this will provide us will classes for each crop and animal type that are straight-forward to use and instantiate.

The video below demonstrates how to do this.

Task 3

Use the above video to create the sub-classes required for each type of crop and animal.