EDIT: i fixed the problem i had but now i have another problem
class Intro is derived from class GameState. GameState has some virtual functions. I am trying to do this:
|
currentState = new Intro();
|
but it says Intro is an abstract class even though intro doesnt have any virtual functions. How do i fix?
Last edited on
If it doesn't have virtual functions, ¿why the new
?
If the base class have virtual methods, the derived has them too. If you've got at least one pure virtual method, the class is abstract
Right. Intro has to implement all the pure virtual functions that GameState has. Otherwise it can't be instantiated.