The Penguin Programmer

Squiro, Android, and Ludum Dare

Time for a blog post instead of news this time!

Last year I took part in my first Ludum Dare and had a lot of fun writing a game in C++ in 48 hours, coming out with Squares.

It’s a colour-matching game of reflexes with just two buttons, and placed 149-th out of around 1000 compo games overall, which I’m pretty happy with for a first attempt!

I thoroughly recommend taking part, as well as being great fun it’s also great practice! If you do want to write a C++ game, then the source code on Github might be handy as a reference to see how a game can be put together quite quickly using SFML. But since it was put together on a pretty tight schedule and not much sleep, it might be lacking in comments or quality… (no known bugs though!)

Squiro screenshot


Since SFML supports Android development now, I figured I’d have a go at porting the game to Android. All was well until it game to adding Google Play, by which point it was becoming far more trouble than it was worth! (It needed access to the underlying activity which at the time of development, SFML didn’t give)

Instead, I just rewrote the entire game in Java, and after a rename to Squiro (turns out calling a game something as generic as ‘Squares’ is terrible for marketing purposes, who knew?) released my first Android app!

RPG Tutorial and Libraries

A few people emailed me after encountering some trouble when installing the JsonBox library required to complete the RPG tutorial, due to CMake not producing files compatible with their IDE.

It’s possible to complete the tutorial without using the library file explicitly by including the source code for JsonBox directly in your project and then compiling the entire thing. This makes compilation times a little slower, but it’s a much easier method if you’re having difficulties with installing the library. More details are in the tutorial itself.

Hopefully that clears things up!

New Website!

Old site is available at Links are broken I’m afraid, so you’ll have to add old. in front of the domain each time. I’m very sorry!

Hi everybody! Welcome to the new Penguin Programmer website which I’ve been working on for quite some time now. I’ve moved away from Wordpress and migrated to Jekyll, an absolutely wonderful static site generator written in Ruby. The old site didn’t use the dynamic aspect of Wordpress very much because I barely posted, so in the end it just acted like a giant weight slowing the rest of the site down and turning it into a fat, bloated mess of code. Now though, with an universal markup format (markdown) and much much easier customisation, performance and usability should be much improved!

General performance has doubled I think, so no more long page loads (and it’ll get even better when I figure out how to stop uncss from butchering my javascript), and I’ve restructured the site to make everything more consistent. This means that it’s easier for me to add content, and hopefully easier for you to view it!

The Tutorials

That’s enough about the site, but the tutorials have received a major upgrade too! I’ve completely rewritten the Beginner’s Tutorial and RPG Tutorial from scratch and they’re much better this time. The Beginner’s Tutorial covers more content and proceeds a little bit faster than the old tutorial, but it’s been reordered to be less jumpy and more C++ rather than C focused. I’ve also added an exercise to the bottom of each section. These are designed to be doable at the stage you are in the tutorial, and have example solutions so that you can check how you’re doing. They might be a little mathematics-heavy, but that’s the easiest way to keep them small!

The RPG tutorial has also been mostly rewritten in order to be much more extensible and easy to design content for. Specifically, I’ve introduced the use of JSON files to store the content, so no more hand-programmed game! The basic game engine is written in C++, with the JSON file defining the game world and the story. This doesn’t mean it’s more complicated though, and again by reordering the components I think I’ve actually made it more understandable than before. Overall it now resembles one of my other projects, Crawler, which is a text-based RPG engine (albeit a more advanced one) written in Ruby that uses the same (or very similar) JSON format for storing its game data.

The tutorial on Data Structures has been preserved, and will be updated as I continue to develop the site. I’ve removed the hangman tutorial (apologies to the very small handful of people that actually read that) and some of the other small articles that barely anyone read, and am now consolidating things into an “Intros” subsection which covers material too small to be made into another proper tutorial but is still handy to read.

The Old Site

The nature of the tutorials on this site means that I’ve no doubt interrupted a bunch of people in the middle of the tutorials, and suddenly changed all the content so that they can’t continue. Because of this I’m keeping the old site available for a bit (maybe a week or so) before taking it down, it’s available at and is exactly the same site as before. So if you’re in the middle of a tutorial, finish up there and come on over here where everything is a bit more modern and fresh!

Subscribe via RSS