Game Programming with C++ and Gosu
I’ve always had a desire to make computer games. It obviously stems from my misspent youth playing Nintendo and getting a serious case of SAD. Sadly, I’ve grown up now and spend my days writing code instead of playing games. I’ve not realised my dreams of becoming a professional games designer but it’s something I’d like to do as a hobby.
I’ve been doing a fair bit of hunting round to find a decent set of tools to get me started. Coding everything from scratch doesn’t really appeal to me so I want something that does all the donkey work of setting up windows, graphics devices, sound and controller input, without being a full blown Game Engine. I also don’t fancy learning another programming language, so ideally it will be a C++ library. It must also be cross-platform as I use both Mac and PC. During my search I’ve looked at SDL, Allegro and Gosu and have decided that Gosu is definitely the way to go.
Gosu is pure object-oriented C++ goodness (Ruby bindings are also available), the API is neat as it is made up of only a small collection of classes. It is primarily for 2D games but it has support for mixing in OpenGL if you are brave enough to do some 3D. It is built on top of the Boost libraries (See my previous post on Installing Boost), so if you need advanced stuff like threads you can get those without too much hassle. It’s also cross-platform as there are binaries for Windows, Mac OS X and Linux. One of the real bonuses is that it is actively being developed and has some fairly comprehensive online documentation.
The getting started guides on the Wiki are great, and walk you through all the basics from installing and setting up a project, to writing a simple game. After I’d got everything installed properly it took me about an hour to code up a really simple Snake game clone from scratch. I’m going to play with it some more and see if I can knock up something a bit more advanced. Next stop Space Invaders!