Hi All,
I am writing a new game engine / game based on a previous project I have which does a few basic game 'things' (such as loads a map, player can move, enemies shoot at the player).
Now for my new project typically I would open up Visual Studio, go to source file, add new .cpp file, call it winmain, copy the winmain from the old 'working' project over (which is pretty much this template from the microsoft MSDN). Now winmain pretty much just creates a game object, init()'s it, then gets into its run() loop.
So then I will copy game.cpp and game.h over, because at this Game class level most things are the same, as in a fixed time step, Game::update(), Game::render(). But then I will have to start deleting things in the game specific areas such as Game::CreateSystems()...
Is this an okay way to go about things? It feels a bit messy because now I have e.g. 3 winmain.cpp's in different folders (m e.g. C:\C++\Game1, C:\C++\Game2, C:\C++\Game3 to which I may have done slightly different things for the different games)...
I am trying to learn good habits of modularity and refining files until I am happy with them and can slot them in and out as I please (I understand there will be a limit to this depending on the game...)
I would ideally (wayyy down the track), like to have everything pretty modular that could be loaded into any game I make (any that uses the same soft of style e.g. just sprite based 2D for now). So for instance I would like to be able to load in a base AI and Pathfinding class that can be built upon in game for my game specific requirements.
Comments and thoughts are appreciated. Thanks