O'Reilly logo

Beginning C++ Game Programming by John Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. 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 in a little more detail:

  • How to extend and modify a class using inheritance?
  • Treating an object of a class as if it is more than one type of class by using polymorphism
  • Abstract classes and how designing classes that are never instantiated can actually be useful
  • Building an abstract PlayableCharacter class
  • Puting inheritance to work with Thomas and Bob classes
  • Adding Thomas and Bob to the game project

Inheritance ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required