   How do you exactly code a game
  I know the title looks silly, but I mean how do you go about coding a game, knowledge of graphics isn't enough to teach you how to code it, till now I had been been coding games that basicall follow this pseudo codeInitialize();Variables;Game loop{    If variable at is 1 show title;    If variable at is 2 show the first town    ......}DeInitilize();So as you can see, I have been using a variable, in this example at to tell whether I am at this place or another, and according to it, the game is rendered.Another way I had been using was by creating many game loops, keeping a condition which is made false after the work of that loop is done.Is this way systematic enough for large games, I mean can this be used in games that have long stories and such? I would appreciate if someone could give me a link to the source code of a game, preferably C++ and SDL, since I am doing 2D for now, but OpenGL would be just as nice.   
  Take a look at the State design pattern. Also, this article should be useful.   ;Here is a sample of Game State Management in XNA. You don't need to be a XNA playboy to understand it :)   