Samael88
Evil always finds a way
- Reaction score
- 181
I am kind of going back to basics again since I have not been programming for a while.
If I have a class called Game_State.
In this class I have all the things necessary for my game to work.
How would I then go by to make a game state manager class that can handle the states?
I have come this far that I need some kind of pointer that points to the state currently running.
How could I get the states to communicate in a practical way?
If I have the Main_Menu state running and I choose to start a game with a certain map, then I would need to send two messages basically:
1. What game state should be loaded.
2. What map should be loaded.
Do I have to go by global variables or is there a practical way to make them communicate?
If I have a class called Game_State.
In this class I have all the things necessary for my game to work.
How would I then go by to make a game state manager class that can handle the states?
I have come this far that I need some kind of pointer that points to the state currently running.
How could I get the states to communicate in a practical way?
If I have the Main_Menu state running and I choose to start a game with a certain map, then I would need to send two messages basically:
1. What game state should be loaded.
2. What map should be loaded.
Do I have to go by global variables or is there a practical way to make them communicate?