Another day. Another question.
Alright guys I've successfully programmed a pong game in SDL and would like to now move on to making a pacman or something similar, but I have a question as to how to have a gamestate class that calls functions. I've thought about just having it contain the game state and having a pacman, ghost, and menu class take in the current state but having a get function in the game state class. But I'm afraid that then I will have a bunch of objects checking for updates and running a switch case.
I also thought that it would be easier to run everything from one swtich-case statement in the gamestate class.. and have it seperated to do input, then logic, and finally rendering, but the only problem with this is I would have to either pass every object instance to the gamestate class or make them all global(I know REALLY bad). So I guess my question is what's the correct approach. I've seen a few that suggest creating a hierarchy does this method involve all objects to be parented by the gamestate class. Hope this is clear.