Good way of handling class instances in game development?
- by Bugster
I'm a new indie game developer, and I've made a few games, but often times when coding I wonder "Is this the way most people do it? Am I doing it wrong?" because I'd like to become a game developer some day, and I really want to get rid of bad practices in time.
The way I'm doing it right now is like this:
#include <some libraries>
#include "Some classes"
int main()
{
Class1 a;
Class2 b;
Class3 c;
a.init();
b.init();
c.init();
// game logic;
}
Now as I see the game grow, I have more and more classes to initialize and create instances of. This is clean but I'm not sure if this is standard practice. Is this a regular way of creating instances of your game classes or is there a cleaner and more efficient way to do it?