Advertisement

Inheritance

Started by March 14, 2001 04:23 AM
0 comments, last by Freeride Designs 23 years, 10 months ago
I''m making a tetris game for a school project, and we have to include inheritance in this, so I was thinking of making a base class Shape, and then derived classes for each different shape, does this sound like a good place for inheritance, any other ideas where it could be used? ----------------
Freeride Designs
----------------
----------------
Black Edge Games
----------------
quote:
Original post by Freeride Designs

I''m making a tetris game for a school project, and we have to include inheritance in this, so I was thinking of making a base class Shape, and then derived classes for each different shape, does this sound like a good place for inheritance, any other ideas where it could be used?

----------------
Freeride Designs
----------------




Sounds like a very good place for inheritance. e.g. all the
shapes must be able to turn. So add a pure virtual function
turn() to your base class and override it in our derived classes.
(Computer && !M$ == Fish && !Bike)

This topic is closed to new replies.

Advertisement