No Time To Play

Archive for June 1st, 2017

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 python.org; either way, you also need to install the library, either through a package manager or directly from pygame.org. Make sure you get compatible versions for both.

(continue reading…)

2 Comments :, , more...

Posts by date

June 2017
M T W T F S S
« May   Jul »
 1234
567891011
12131415161718
19202122232425
2627282930  

Posts by month