[SDL] Game event loop and input
thebigcheese at jobybednar.com
Thu Jan 30 16:43:01 PST 2003
I'm starting to map out the various stages of my game, intro, tutorial, game play, cut scenes, etc. and it is getting a little ugly when it comes to what I envision as user input and the basic event loop. I'm thinking I need to create a global that stores the current game state and use a series of case statements within the PollEvent loop. This seems a bit bulky though and could run pages long.
Has anyone had experience in developing a custom class that you can use to wrap around the event to simplify the event structure with respect to your game states? Or perhaps other ways that you have found especially effective in keeping code clean and simple?
Give someone a program - frustrate them for a day.
Teach them how to program - frustrate them for a lifetime.
More information about the SDL