So I thought I’d try Code::Blocks

Code::Blocks is an alternative cross-platform open source IDE for C/C++ (and Fortran!). It doesn’t include a compiler but can work with most of them. It’s also written in C++ (you’d never guess from the name!) and so is fast.
Installing is just a
sudo apt install codeblocks
When you install it, it looks for installed compilers and gives you the choice of which is the default.
When you create a project there are a few types and one that got me excited was SDL. It creates a skeletal project and it was only when compiling that I realised it was for SDL1, not 2. It’s the nature of open source that things take time to remedy. So don’t bother with it.
Anyway I copied in my source files and clang objected because it couldn’t find the SDL2 files. The fix isn’t too difficult. In Code::Blocks, navigate to Project Build Options then in Compiler settings > Other compiler options add these lines
-lSDL2 -lSDL2_image -lSDL2_mixer
and in the Linker settings > Other linker options
-lSDL2 -lSDL2_image -lSDL2_mixer
Note those are -l () not i or 1.
After that it compiled and linked ok. The compiled code is in the bin/Debug folder. However to get Asteroids to run you need to copy in the images, sounds, and masks folders and the highscore.txt file. After that it runs fine, but note when you compile it seems to delete everything in the folder.
So overall it wasn’t a difficult thing to do and I’m going to install it on a Raspberry Pi and see how that goes. I’ve already got Visual Studio Code installed on it and working but having a second IDE (both using the same compiler) is no bad thing.
I’ve done 70 odd blog posts so far since I started this in March 2020 and there’s a fair number of gems and nuggets in there. Finding them though is probably a bit of hassle, so to let you see them easily, I’ve created a page of tips, accessible from 
Unfortunately there’s no gamepad-tool for the PI, but there is a program called jstest and in particular a visual one called jstest-gtk. That’s it on the left. You install it on any Linux system, including Raspbian on the Pi with the command
I’ve never dealt with a game pad (joypad etc.) before. It seems that there is no absolute mapping, it’s more like TV remote controls. There’s lots of them and they’re all different. So although SDL2 has a set of enum values for the buttons, I found that my game pad wasn’t responding to what I thought were the game keys.
Back in November 2018, I was in Nottingham and passed a stand at the Winter Fayre. It was offering a console with 18,000 games on it for about £70. I bought one and what I got was an Orange PI with a 16 GB SD Card (all but full) and two USB joypads.
When programmers have to explain why it took longer to get something working,you don’t often here reasons like this. A simple syntax error error took me an hour to find and fix. Yet it does happen and it happened to me today.
Yes it is possible, as the screenshot shows. You can download a copy of Raspbian from 
The publisher Springer has made a whole raft of their books available
In my ebook I talked about professional games using a resource manager. Games like Quake 2 use a .pak file which stores all images, levels etc. The first stage towards writing a resource manager is to have some way of compressing files. Most graphic file formats such as jpg, gif and png are already compressed. But other files like level files aren’t, typically text and so will compress well.