'Changing function in an object's member
I am trying to write a very simple game using C++ and SDL2. I have a gameObject class and a player object. I am trying to change the update function for the player member only. This is because in the future, I might add something like an enemy object and have different update code for that.
Please help, or if you have an idea of a better way to do this, please let me know.
player.Update(); needs to be different than enemy.Update(); both of which are in the gameObject class.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
