I am creating a game, and I'm using a simple "updater" class to handle game logic. I do this by calling the "Update" function of each object currently in a vector (of Object*). Cycling through the objects and calling Object::Update works fine, but I need to know how to call the overloaded Update. I've tried just overloading the Update function, but that didn't work. Could someone help me with this?
(The code isn't needed, it has nothing to do with it).
tl;dr: How can I call the derived class' function instead of the base class'?
You need to make the Update function virtual.
Again, I forget about the basics. Have a useful.
Sorry, you need to Log In to post a reply to this thread.