I am just wondering what are some of the issues of loading and freeing the memory every time player changes the game state?
Or is it better to load all the resources at once?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
The answer is game specific, and vastly depends on what you define as a "state". Does your game "change state" when moving from the main menu to the game itself? Then you should probably unload resources for the main menu and load ones meant for the game.
Does "game state" mean you moved from your game's "attack phase" to "defend phase" which have no new assets? Then probably you don't need to load or unload anything.
Here are some tips and things to remember: