Game development, episode #1: the gameloop

I suspect that most of the readers of this blog are programmers, so I must start by saying that game development is a broad activity that includes several areas and not only the programming. Of course that I am a programmer so the focus on this series will be programming but I will also try to provide some resources related to the other activities. So, after this brief comment it’s time to switch to the main topic of this post: the gameloop.

From the programming point of view the main component of any game is the gameloop. This loop performs several tasks that can vary depending on the platform your game run on but conceptually these tasks can be summarized in 2:  execute game logic and drawing.

Of course we can drill down into these tasks and get a more detailed game loop like the following:

while ( not gameover and user not exits)
  process user input
  execute AI
  resolve collisions
  draw graphics
  play sounds

The gameloop is main component of any game but not the only one, there are some other components that are not part of the game loop: stuff like the game menu and the settings screen among others.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.