Using virtual functions

Posted by Tucker Morgan on Game Development See other posts from Game Development or by Tucker Morgan
Published on 2012-03-25T02:05:10Z Indexed on 2012/03/25 5:40 UTC
Read the original article Hit count: 429

Filed under:
|
|

I am starting to use virtual functions, and i am programming a simple text game, my question is this, if i have a virtual function called spec_abil with in a Super class called rpg_class. If you allow the player to class what class they want to play, say a mage class, a archer class, and a warrior class, which all have their own spec_abil function. How do you write it so that the program knows which one to use depending on the chosen class.

© Game Development or respective owner

Related posts about c++

Related posts about game-design