At 5/1/13 03:07 PM, Glaiel-Gamer wrote:
Yeah, I had a pop and push system sorta half-implemented in there, the problem is you want your pause menu to render on TOP of the game, not INSTEAD of the game, and transition states need to update and render simultaneously
passing information between them I had a function of the state manager for that using a std::map (Dictionary in AS3)
ReadMessage("messagename", bool deleteAfterReading = false) [returns "messagedata", or "null" if no message with that name was found)
Oh hey, nice and simple messaging! I'ma steal that right now :)
And for the popping/pushing states, I figure that when you push a state on top of another state, then the pushed state renders on top of the previous state, creating the pause menu effect. (Sounds like a movie...)
And to handle transitions, maybe they should be thought of as 1-way transitions. You give the old screen an out-transition, the new screen an in-transition. This detaches transitions from needing previous states to transition from, and so the pause menu would simply have an in-transition, and it should work fine without transitioning out the game state.
And obviously in lots of cases you'd want to have an in transition match an out transition etc. Hell, you could even have the transitions talking to each other in cases where you need perfect syncing...
I need to implement what I just said, it sounds really flexible and awesome in my head! :)
BTW, when working with C++, did you just start raw, with SDL or OpenGL, or use a library for graphics handling?