Hacker News new | past | comments | ask | show | jobs | submit login
Invent Your Own Computer Games with Python (Free e-Book) (inventwithpython.com)
113 points by jbail on Nov 16, 2010 | hide | past | favorite | 22 comments



This tutorial is great for beginners, but if you have some experience with Python, you might want to try sjbrown's advance tutorial using Pygame and Twisted.

https://github.com/sjbrown/writing_games_tutorial


Another source that I found helpful - Python Osmosis http://python.sourcequench.org/ - a video series tutorial with 50 episodes. I used both Python Osmosis and Python the Hard Way to get started.



I think the book is very good for beginners as the code is just one piece of python code and not multiple sources projects which will confuse noobs to the language, this help the newcomers to really grasp the language; I'm following both this and learn python the hard way by zed shaw which make a great combo for learning the language.

I'm a newcomer to programming and I've found some errors in the code (or maybe things that don't work with Python 2.6) and I've get it to work either way, the only hassle is that I offered the author to provide what I changed in order for the code to work and I never received an answer.

In any case is a good way to start learning.


I just said on another post that I wished someone did this with more modern languages like Python or Ruby. I guess someone did, and someone heard me!


To add to the free Python book fest, Learn Python the Hard Way http://learnpythonthehardway.com is excellent for beginners. If you do know how to program, Dive Into Python http://diveintopython.org is also excellent.

They're both free.

I've been programming for awhile, but I read both books and took useful things away from both of them.


DIP has a few pitfalls, mostly related to old technologies, but it holds up surprisingly well.

For HTML processing, you're much better off using the BeautifulSoup module than the process outlined in DIP.

The web services chapter is still solid on generalities, but these days a growing number of RESTful (or REST-ish) services deliver content in JSON. As of Python 2.6, the standard library includes the json module, which converts a JSON object into a native Python list/dictionary. (For earlier versions, the same library is available in the third-party simplejson module.) If you're targeting 2.x, you can always import json this way:

    try:
        import json
    except ImportError:
        import simplejson as json 
For RESTful web service interaction, Dive Into Python 3 includes a useful chapter on using the excellent third-party httplib2 module, which is definitely worth reviewing as httplib2 is available for 2.x.

The SOAP web services chapter is well past its best-by date (as is the SOAP protocol itself). If you need to access a SOAP web service, the third party suds module is pretty good. (As far as I can tell, the SOAPpy module is no longer actively maintained.)


Just keep in mind that Dive Into Python hasn't been significantly updated since 2004.


I've been trying nearly all the code samples and haven't run into any issues yet. I'm using version 2.7 of Python though. Haven't upgraded to 3.1 yet.


There is a "v3" version and the "v2" version is sufficient to learn from despite not having been updated for a while.


The choice of the word "Invent" bothers me here for some reason. In writing a computer program, you might end up inventing a technique or data structure, but the program itself doesn't seem to be an invention. I suppose the game rules themselves might count as an invention, but that also feels somewhat odd.


A game is a fantastic invention, literally creates a kind of world. Aiming at young people, the attractiveness of a system to perform this miracle warrants the title.

In reality, invention responds to a need and cannot be generally prescribed. Generate all numbers from 8 to infinity and there you have a representation of of all possible games. Playing them is another matter--so giving some impetus to God's own prototypes seems fitting.


Yes. Though the usual word for new games tends to be `create' rather than invent. I don't believe there's more than a linguistic significance to the choice here.

(Though you can `invent' new game mechanisms.)


I always think of game development as discovery rather than invention. Most game mechanics either already exist, or are distilled from psychological truths.


FWIW, games are patentable inventions according to the US Patent Office.


Perfect timing. I was looking through books for my younger brother, who wants to be a game developer, and this will serve well as a Christmas gift.

Seeing as this book's dimension isn't ISO 216-standard and I want to support the local printers, what dimension would be the best to print it in?


Just got this for my younger brother in September. Good book, though like with most younger brothers it still requires prodding to get him into it.


I make and sell Python games professionally so I'll definitely check this out. If I had a child that I wanted to expose to programming, getting them interested in playing and making their own games is definitely how I'd do it. And I'd definitely start them with Python, since I feel it's both a simple/easy language to learn, plus, it "scales up" into still being a good professional tool as well. (A quality which didn't apply to my first language, Applesoft BASIC, oh so many years ago.)


Can you share a few titles of the games you make? I'd like to see python game.



I learned a little bit about programming as a kid with those books that just had re-prints of BASIC game code. The time spent debugging my own typos was pretty valuable.


me too! i remember seeing source to games like Lunar Lander, Kingdom, and some simple Adventure/Zork-likes printed in books and magazines like that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: