Tales of the Rampant Coyote

Adventures in Indie Gaming!

A Free Book to Help You Learn to Write Games in Python

Posted by Rampant Coyote on November 15, 2010

This isn’t exactly a new book or anything, but it’s free. And cool. And can teach you to program games in Python. Booyah!

Invent Your Own Computer Games With Python, 2nd Edition

Based on my browsing, there are a few things to note:

First of all, it is written for total beginners to programming. If you’ve always wanted to write games but don’t know anything about programming, this could be one place to start. It seems to be more oriented towards teaching you to program in Python first, and to make games second. But it teaches you to program through games, which I think is the best way to learn.

Secondly – it really teaches you the way I learned to program. Using PyGame with graphics and sound isn’t tackled until the end of the book. The games it has you write could have come right our of Basic Computer Games from 1978, and then ported to Python. It may not be too far from the truth, as the author says he modeled it after a book he used to learn programming when he was nine years old. This approach may annoy people who really want to jump straight to the flash, but if that’s your approach I’d recommend, uh, Flash. Or something like that.

Anyway, having only skimmed through it I can’t really give a full review or recommendation or anything – I can just suggest it as a resource.

Filed Under: Programming - Comments: 12 Comments to Read

  • skavenhorde said,

    Thanks, Rampant. I’ve been fiddling around with the idea of making a game, but have no idea where to start. Just a very short, rat based game mind you. πŸ™‚

    One hurdle that I won’t be able to surpass is artwork. I can’t afford to buy art and I can only draw stick figures, but I’ll still give this a look. There are some great games out there with poor artwork like Paper Zombies.

    Speaking of that I wanted to ask, did you do the art in Frayed Knights or did you hire someone to do it?

  • Rampant Coyote said,

    Yes, and yes. Some of it is contracted out, some of it is off-the-shelf content I licensed (and sometimes modified) that you may see in other games, and some of it was done by me. Generally, the latter is easily identified by its crappier quality.

  • Xenovore said,

    Although clearly oriented towards the younger crowd, it’s not a bad little book. And yeah, it’s quite reminiscent of a couple books I learned programming with back in the ’80s. =)

    @ Skavenhorde: Yeah, art can be definitely be an issue, but it shouldn’t be a show-stopper. You can grab all sorts of stuff off the ‘net to use as placeholders while you prototype your game. (Ya just gotta make sure that before you release your game, all copyrighted stuff is replaced or removed.) And practice your art, of course! Maybe you can only do stick figures right now, but keep drawing stuff and you’ll get better. =)

  • Anon said,

    “but if that’s your approach I’d recommend, uh, Flash”

    If you’re learning AS3 the right way then you’ll be taking the approach. That’s HILARIOUS that a scripter who writes in one form of babycode (Python) snubs his nose at another. Stick to C if you want to be self-righteous.

  • Rampant Coyote said,

    I did not intend on coming off as self-righteous at all, Anonymous, and I’m sorry you saw it that way. I write in C and C++, principally, and love Python, and would love to do more with Flash but I honestly do not have the time. But there are many tools out there – including Flash, TGB, Game Maker Pro, and others – that will let you get to the flashy parts (sound, animation, graphics) very quickly – although in each of those cases you are going to have to get down & dirty with code in order to get far with something cool & interesting.

    But thus my joke about Flash being better for getting straight to the flash.

    Sorry if I put you on the defensive somehow. But if you read this blog a lot, you’ll know that while I don’t keep up with all the indie Flash-based games that are out there, I try and give them their due respect and kudos when they show up on my radar. Ditto for games made with RPG Maker, Game Maker, or any other game creation system that’s even less programming-intensive to get a quality game out there.

  • Kelly said,

    Thanks so much for pointing this out! I’ve been messing around with game maker pro for the past year, and have been interested in learning python for awhile. So yeah, I bet this will help. Thanks again!

  • Greg Tedder said,

    I have always wanted to learn more python, it is a fun language with a lot of cool uses, and I have actually done some web programming with it. I have been looking through this book, and I hope to find time to play with it soon. Neat stuff.

  • Greg Tedder said,

    Oh, and one other fun note, python is one of the best scripting shells run calculations on. When I am getting into multi process math problems I always use a python shell so I have a near copy paste record of why I did to get it right. I’m not exactly a math wiz. πŸ™‚

  • skavenhorde said,

    Thanks Rampant and Xenovore for the advice. I’ll keep it in mind. Too bad making art on the computer and painting miniatures don’t seem to be compatible for me. πŸ˜€

  • James said,

    Thanks. What is the difficulty level doing this compared to using Game Maker? As this is the only games creation ive done as yet.

  • Rampant Coyote said,

    I don’t have enough experience with Game Maker to REALLY answer that question, James. I’d say it’s probably a little more difficult, but if you can handle Game Maker you could probably handle this. They are roughly equivalent. But this would teach you a little more about programming.

    But my other recommendation would be that if you are getting good at Game Maker, keep at it, until you are really struggling against its limitations and know why you’d want to change. Learning Python this way wouldn’t be a bad idea just to broaden your skills, but I wouldn’t switch just for the sake of switching.

  • Orusaka said,

    @James: I would not really recommend Python for game programming. I’d suggest, if you are ready to move on from Game Maker, that you look into one of the basic dialects made for easy game programming. Either Dark Basic or BlitzMax. I believe Eschalon was written in BlitzMax, if I’m not mistaken, so you can make proper games in these languages. Both of those dialects are OOP versions of Basic, so they could get you started on proper programming, too, if you are looking for that. For that matter, so could Python, though.

    All of that said, if you’re looking to get into programming, get a c++ book, spend a few weeks learning, then look into Allegro. It’s a C/C++ library I’m completely in love with. It makes game-making in c++ as easy as with the basic dialects I mentioned.

    In the end, though, if you’re happy with Game Maker, there really is no point in switching over to programming from “scratch”.