So my game is done for now but every time it flashes on the screen and my game loop is awful. So crowded with logic.

I need to learn more about games and how they are running. My idea now is that at the heart of the game you have a while loop. Inside that you are checking for events to happen. Each time an event happens, you spawn a thread that accomplishes a task.

You then have a layer that draws on the screen the "map". Also a layer that says where objects collide. And finally the logic of how objects interact.

I am using C++ and SDL and I need a complete tutorial that takes me through a complex example to get started. I am a good programmer but have no experience with games. Any suggested tutorials would help.

All tutorials I have found so far are too easy and don't do anything worth while.

  • \$\begingroup\$ if you are looking for a good SDL tutorial, you should take a look at Lazyfoo's but there are too many other great stuff out there. Check Other available tools before deciding to use SDL. \$\endgroup\$
    – Ali1S232
    Dec 21, 2012 at 21:57
  • 1
    \$\begingroup\$ Tutorials being too easy indicates you don't need them. Make a game. \$\endgroup\$
    – Anko
    Dec 22, 2012 at 2:21
  • \$\begingroup\$ What would you use if not SDL? \$\endgroup\$
    – joncodo
    Dec 22, 2012 at 11:11

2 Answers 2


The Lazy Foo articles section was a great guide for me. Obviously his tutorials are top notch for sdl but these cover other things like game loops, state machines, ai etc.


My game loops are just an extension of his ideas in the game loop article and its served me well.


I'm not a very good game programmer but I'll try to help you.

I suggest a very good book on game engine concepts called "Game Engine Architecture". You should definitelly read it.

And one more thing: dive into the code of open-source games like Supertux and Kobo Deluxe. Both have very good performance and well organized code.

Hope it helps! =)


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .