No Time To Play

Tag: pygame

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...

How to program your gamepad

by on May.16, 2013, under Gamedev

Thrustmaster Dual Analog 4 gamepad

I’ve entertained the notion on and off as of late, but when I finally acquired a gamepad it was a spur-of-the-moment decision (and possibly a bad one if my finances don’t improve). The tipping point was the double realization that supporting a gamepad is actually quite easy, yet relatively few Linux games bother, so I could add support in my own games — learning how it works in the process — and perhaps raise awareness of this issue with a platform that still struggles to gain acceptance among gamers.

There was also the fact that very little appears to be written about actually designing games to work with a gamepad versus mouse+keyboard, as if it was a simple matter. And that’s really odd, considering how the control scheme is usually the biggest complaint about games ported from consoles to the PC.

(continue reading…)

1 Comment :, , , more...

Square Shooter on the desktop

by on Jul.16, 2012, under Gamedev

Square Shooter was my first HTML5 game, and while that has allowed me to show it off easily (and brag about it when HTML5 was still fairly exotic), I always wanted a desktop version as well. And I made one! The most intense coding marathon I’ve ever done (500 lines of code in two days!) resulted in a game that’s easier to control and understand, and looks better to boot.

Let me tell you how I did it.

(continue reading…)

3 Comments :, , , more...

Posts by date

September 2017
« Aug    

Posts by month