Before drilling down into technological stuff I want to share some basic concepts.
Collision detection is a very common concern in games. It consists on determining whether two objects have come into contact with one another. In games, this is necessary in order to make decisions, for example, in games like Mario Bros., it is important to know whether a Mario has collide with a tortoise or a coin. In order to detect collisions, each object has a bounding box, that is an approximation of the object’s surface.
A sprite is a a small bitmap image (or set of images) used to visually represent . Another kind of bitmap is a tile, which is usually used for background maps.
During the drawing process all the sprites and tiles are drawn incrementally into a buffer and then this buffer is dump at once into the low level buffer that will impact on the screen. This technique es called double buffering.
To be continue…
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
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.
In a while I will start working on a new project related to game development and I thought that it was a good opportunity to write some stuff about it.
I have never been involved in commercial games development, but I have background on the topic. I been teaching object-oriented programming at Fiuba and most of the programming practices are related to games, because they provide very good scenarios to apply may OO concepts. At the same time I have also been involved in the development of a simple framework to create loop-based games called titiritero and that is used by our students to perform their programming practices. And of course I have also implemented my own games, but that was a long time ago (I remember I used Delphi 4 and C++).
So, let’s start by setting the expectation so you can decide to continue reading or not: along this series of post I will write about development of simple loop-based games which covers most of the games that you can currently find in mobile devices. I will share some basic concepts that you can apply no matter which technology you use for the implementation. Regarding the implementation, I will focus on Microsoft technologies and particularly in XNA Game Studio.
From now on, you will find all articles in this series under the tag gameDevelopment.