Breakout

Logan Smyth's picture
Submitted by Logan Smyth on Sun, 02/01/2009 - 00:00

As nice as Java graphics are, I wanted to learn to code graphics in a language that was a little more solid and made me feel a little more in control. So, setting out with the knowledge of C I'd picked up over the past few years, I went about learning C++ and graphics.

I originnally planned on learning how to do 2D graphics first, and that is when I stumbled upon the SDL graphics library for C/C++. It is super handy because it removed a lot of the hassle from creating a window by being platform independant. SDL is very nice and simplifies a lot of things, but its built in image processing would have ended up being pretty annoying to use to code an actual game. After reading some forum threads, I was pointed towards just using OpenGL to render 2D textures.

Thus I started learning OpenGL. I approached this by using the tutorials hosted on the site of NeHe Productions. Those tutorials were extremely helpful, as well as the SDL tutorials by Lazy Foo Productions.

My first game ever, written in Java when I was in Grade 11, was Breakout so I thought it was fitting to code an actual decent version as my first excusion into the land of C++ graphics.

In the end, the game was playable and is pretty fun. When the ball hits a block, it makes a little particle explosion that slowly fades away, and the blocks slowly change color until they explode into particles and vanish. I had consider adding items and things, but I never got around to it.

The code is up on GitHub.

Add new comment

You are here