I am making a game, in the game a have a list that holds the player, this list deals with the class Player. I also have a class the is a child of Player called HumanPlayer. I have added a a human player to the player list. but when I run a render function it doesn't render from humanplayer it renders from player. The render function is a virtual function, that should be overwritten but it not.
Here is where I define the list:
std::list<Player> playerList;
here is where I add a humanplayer to the list:
playerList.push_front(HumanPlayer(512,512,&entityList));
Here is where the render function calls the render:
if(!playerList.empty()){
std::list<Player>::iterator iter;
for (iter = playerList.begin(); iter != playerList.end(); iter++){
iter -> render(canvas);
}
}