1
General discussions / Re: SFML Game Development -- A book on SFML
« on: August 14, 2014, 07:42:39 pm »
I bought the book and also took a look at the Gamestate Manager. I used a similar system up to now and have a question I couldn't find the answer to in the book: How do you pass information between the states? Consider for example that I have a menu state where I select a level. When I continue to the load level state, I still have to know, which level was chosen in the menu. Or for example a highscore state, where the score is sent to the web and compared with others - how does the highscore state know the score from the game state?
Is the State::Context where you would do this? I rather understood the Context as a collection of pointers to all the technical stuff in the background - not as a place where any game logic happens.
Is the State::Context where you would do this? I rather understood the Context as a collection of pointers to all the technical stuff in the background - not as a place where any game logic happens.