Chapter 15: Advanced OOP – Inheritance and Polymorphism

In this chapter, we will further extend our knowledge of OOP by looking at the slightly more advanced concepts of inheritance and polymorphism. We will then be able to use this new knowledge to implement the star characters of our game, Thomas and Bob. Here is what we will cover in this chapter:

  • Learn how to extend and modify a class using inheritance
  • Treat an object of a class as if it is more than one type of class by using polymorphism
  • Learn about abstract classes and how designing classes that are never instantiated can actually be useful
  • Build an abstract PlayableCharacter class
  • Put inheritance to work with the Thomas and Bob classes
  • Add Thomas and Bob to the game project

Inheritance ...

Get Beginning C++ Game Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.