Game Example: Space Pong

Nokturn, 10. Oct. 2002

This source example shows how a complete game is coded with just a few lines. Originally I planned to use not more than 150 lines, but I added that "star" feature and so it became a little less than 250 lines. However, I if I didn't count all the empty lines which I like to use to make seperations and if I didn't count the license and the header at the top of the file (which I will leave out below), I would probably fit into these 150 lines ;)

Well, what I coded is a little pong game which takes place in space. The games makes use of 32 bit graphics, a 640x480 resolution, a sound effect saved as wave file, 2 musical themes, one for the title and one for the game mode, sprites and text to display scores etc.

As I already indicated, the game is divided into the main part and the title screen part.

Here comes the code. Look below for screenshots!

You can download the whole game including all the files I used as the distribution, which is called GMSpacePong20021007 (filename is GameBlade-GMSpacePong20021007.tar.gz) here, under the GameBlade-Game package.

Oh and by the way this game took me 1 hour of coding time (+1 hour for the stars;))

Click here to view the source file!


SourceForge Logo