No Time To Play

A brief guide to Pygame

by on Jun.01, 2017, under Gamedev

For a web developer moving into games, HTML5 was a natural first choice. Doubly so for a Linux user who wanted his games to run on other operating systems without much fuss. But browser compatibility wasn’t so great either (it still isn’t even in 2017), and many people don’t like playing games in their browser, for all the convenience it brings.

Having just discovered the joys of Python, and happening to like a game made with it — called Monsterz — the Pygame library was an obvious choice. It’s ported to all the major platforms, well-documented, and very easy to use while still powerful. I remember seeing complaints about the Pygame community online, but my experience has been good.

One downside is that up until the recent revival Pygame only worked with Python 2.7, but then it’s what Mac users get by default; I’ll try to keep my code forward-compatible in case you have version 1.9.2 or newer. I was also surprised to see just how many Pygame functions I use in practice: over seventy! And that’s still only part of the API.

If you happen to be on Linux or Mac, you already have Python installed, but Windows users need to get a suitable runtime from; either way, you also need to install the library, either through a package manager or directly from Make sure you get compatible versions for both.

(continue reading…)

2 Comments :, , more...

Weekly Links #107: the value of generality

by on Feb.14, 2016, under Miscellaneous, News

Another week, another close shave. It was only yesterday that I found a link worth sharing, but what a find! Over at Vice Magazine there’s a book excerpt arguing that the ZX Spectrum encouraged creativity more than any other 8-bit platform:

Other machines had more sophisticated sound and graphics, and provided built-in features to make writing games easier. A good example is the Commodore 64, which not only had an advanced sound chip but the ability to use sprites, graphical objects that made animations easier to create. “The trouble was, that guided everyone into making games that all looked incredibly similar,” recalled Spectrum games programmer Jon Ritman. The Spectrum had no such hardware support, and yet its simplicity and origins as a machine to be explored made it a flexible medium to create games that did not have to obey the rules. “The Spectrum was just ‘here’s a bit of screen’. It’s laid out in a funny way, which is a bit of a pain,” explains Ritman. “But you just draw things. And you could do whatever you want. It might not be as fast, but you can do whatever you want, and I think that as a result you got more interesting ideas on it.”

I wrote repeatedly about the value of working with a dumb drawing surface (always controversially, I might add). And then there’s the bit in Jimmy Maher’s Amiga book where he points out that all the technical cleverness of the platform’s legendary chipset was of no use when Doom came along and required raw processing power. Yet the creativity angle is fresh to me, however obvious in retrospect.

In unrelated news, the amazing Michael Cook recently posted the first in a series of articles about Danesh, his new tool for exploring procedural content generators, and it’s a very promising concept indeed. (Hooray for fuzzing becoming a mainstream programming tool. Whether you call it by that name or not.)

But that’s all for today. See you next week.

Comments Off on Weekly Links #107: the value of generality :, more...

Weekly Links #102

by on Jan.10, 2016, under Gamedev, News

Sometimes experiments just don’t pan out the way we expect them to. But you know, that’s kind of the point. And sometimes the actual results are more interesting than those we were expecting.

I was going to write the article promised in the previous newsletter, but instead I found myself adapting the new mobile UI from the Deep Down prototype to an older game of mine: Glittering Light. Here’s the result after a few days:

So much for doing everything on a dumb drawing surface. Why should I reinvent the GUI wheel when the browser gives it to me for free? Just so it would be more like in other environments? Well, it’s not. It’s a browser game, might as well embrace that. It allows me to inline the credits and proper instructions, have a high score table, and as a bonus the buttons actually work in mobile browsers as well (unlike touch events, which should but don’t). Getting mouse events relative to the viewport was a bit of a problem, but now I can use a secret weapon: jQuery. As for that infamous delay when touchscreens simulate a click event, there’s a reason this game is entirely turn-based…

Experiment “write games using a standard GUI toolkit” is a success. Next, to embrace the paradigm more fully.

In completely unrelated news, my friend Sera alerts me to the fact that the Oculus Rift will cost nearly double the promised amount, and that’s on top of the already expensive gaming rig it needs to be at all useful. Dear Silicon Valley hipsters: some players make sacrifices to indulge in their hobby (and make you rich). Show a little respect. Oh, and you might want to look at a little competitor called Google Cardboard, which only costs a few dollars (by virtue of being make of literal cardboard), works with common smartphone models, and — check this out — is an open design, so buyers aren’t tied to a single manufacturer that might discontinue the product line or even go out of business at any time.

Sure, Cardboard is probably a toy in comparison. But it also has room to improve in leaps and bounds, with minimal investments that will be distributed across countless enthusiasts the world over. Good luck keeping pace.

Until next time, beware of overengineering.

1 Comment :, , more...

Weekly Links #45

by on Nov.16, 2014, under Gamedev, News

Hello, everyone. After submitting VoxelDesc to the Procedural Generation Jam, I figured it would be nice to have an entry developed during the actual jam for a change, which is sort of the point, you know? Especially after getting a ton of visits and not one comment for what I thought was a fairly original concept. As it happens, inspiration struck, and in less than a week I came up with this:

It’s supposed to become a twin-stick shooter, but for now I focused on the procedural parts, namely the level generation and graphics engine (and I had to figure out fast how to bang out a semi-plausible city map, however abstracted — pro tip: BSP trees don’t work here). I’ll hopefully have something to shoot at by the end of the jam, now that the deadline has been quietly extended by a day.

(continue reading…)

Comments Off on Weekly Links #45 :, , more...

Weekly Links #21

by on Jun.03, 2014, under Gamedev, News, Opinion

It doesn’t happen often that I have one overarching theme for this newsletter; usually it’s just that I discuss a single link at length. This time it’s different. Get ready for yet another big rant about 3D graphics. But not just yet.

I want to start with a little video. Via Shamus Young, here’s a fascinating viewpoint on what the mechanics of Civilization (the game) betray about the developers’ view on the actual human civilization. Too long, didn’t watch version: remember Fry’s reaction to the theme park version of history in the pilot episode of Futurama?

Incidentally, the point they make in the video is very similar to Aaron Reed’s critique of the Star Wars prequels from a few months ago: somehow, along the way, we’ve grown used to the idea that history is a preordained series of events, rather than being shaped naturally by the actions and interactions of many individuals. To the degree that we acknowledge people at all, it’s a handful of historical figures seen as demigods who did everything by themselves…

Troubling, isn’t it?
(continue reading…)

2 Comments :, , more...

Buzz Grid on the desktop

by on Aug.20, 2012, under Gamedev

I’m conflicted about this. On the one hand, I’ve spent the last two articles complaining about the difficulties of writing portable software. On the other hand, I’ve spent five days porting Buzz Grid to PyGame, and it came out better-looking that the original!

This time, however, I was able to keep the gameplay unchanged.

(continue reading…)

Comments Off on Buzz Grid on the desktop :, , , more...

Posts by date

September 2017
« Aug    

Posts by month