I’m making a very simple 2D game but I need file saving/loading to disk. I know how to do the file saving/loading, but my question is where to put it? My initial thought was the GameState class, as I clearly remember that there was an Init() function or something like that, that is ran when the game is started. But I cannot seem to find the correct method.
1.Can somebody point me on this?
Also in the documention, I quote
I’m trying to keep track of 2 player properties, the player name, color that he chose and 2 game properties game length between rounds, and the total rounds to play. Give what was said in the documentation, it seems keeping player data is not really a good place. For the player, the player state would be a good place. But I don’t want to have code copy/paste code on two different classes.
- Could there be a mechanism, that can read an entire config file (mine is json) that reads the data in a higher level object, and then passes it to PlayerState (for name and color) and GameState (for rounds and timer)?