A 2D Game Development Primer
11 July 2007I've been experimenting with 2D game development in the last few weeks. It's fun because it let's me combine my love for code and art into one project.
When I first became interested, it took some time gathering information about best practices and methods for creating games. So I'm writing this article for people who are interested but aren't sure where to start.
The Tools You Need
I recommend C++ for game development. It is widely used and there are thousands of tutorials/recources available on the net. It's object-oriented, so it's perfect for modeling real world objects you might see in a game, e.g. paddle.moveUp().
For C++ development on Windows, I recommend Bloodshed Dev-C++, which is bundled with the Mingw compiler.

You can of course develop your game in almost any language, it really depends on how complex your game needs to be.
If you're after extreme speed and efficiency, you might chose to develop your game in assembly language (not for the faint hearted). If you just want to make a simple hang man game, you could use visual basic.
Python is also a good language for game development.
Learning C/C++ is quite easy if you're proficient in PHP, Ruby, Python or any other OO language. Cplusplus.com has a great introductory tutorial for beginners.
If you're coming from PHP and you're not used to event driven programming, you might find game development a bit unnatural at first. Stick with it, you'll get used to it within a few hours.

Getting started
SDL (Simple DirectMedia Layer) is a development library which makes using animation and audio very easy. Handling user input with SDL is also a walk in the park. My first "hello world" application was compiled and running within 2 minutes.
For a quick guide on getting started, have a look at "Setting up SDL in Dev C++". Once everything is set up, start working your way through these great tutorials.
Inspiration
If you want to make a game but don't have any concept ideas, check out the following sites for some inspiration.
- The Linux port of Civilization: Call to Power was built using SDL.
- Amazing 2D art
- The ultimate collection of links related to space
- Games by Apogee software
- Games made using Pygame.
If you're looking for a fun way to learn C/C++, developing a small 2D game is perfect. My first game was Pong, which only took a few hours to complete...
Sam
The sdl websites down :(