Pygame Basics Chapter

Here's the introductory chapter to my next book on Python and Pygame. It assumes you have some Python and programming experience (if you don't, give a look to Invent with Python), and offers a quick view of all of the major parts of Pygame.

The chapter by itself is a good introduction to Pygame. If you've been meaning to give Pygame a look, then download the chapter. Please email in any questions or suggestions you have: [email protected]

Chapter 2 - Pygame Basics

Unfortunately, the links in the book aren't working yet, but should be in a few days.

Read More

Chinese Translation of "Invent with Python" Started

Yuanle Qiu has started translating the "Invent Your Own Computer Games with Python" into Chinese. The first three five chapters are done, with more on the way. Thanks a lot Yuanle!

If you or someone you know can participate in translating "Invent with Python" into other languages (Hindi, Spanish, French, German, etc.) please contact Al for more information. "Invent with Python" is released under a Creative Commons license, so the translated works would be freely available to those who want to learn programming.

Read More

Pygcurse - A "curses" Emulator Built on Pygame

Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, roguelikes, and console-style applications. The mascot of Pygcurse is a blue pig with a skull tattoo on its butt.

Download Pygcurse and Demo Programs.

Read the Pygcurse tutorial.

View the Pygcurse homepage.

Pygcurse provides several benefits over normal text-based stdio programs:

  1. Color text and background.
  2. The ability to move the cursor and print text anywhere in the console window.
  3. The ability to make console apps that make use of the mouse.
  4. The ability to have programs respond to individual key presses, instead of waiting for the user to type an entire string and press enter (as is the case with input()/raw_input()).
  5. The ability to use any font and any character in those fonts.
  6. Since the console window that Pygcurse uses is just a Pygame surface object, additional drawing and transformations can be applied to it. Multiple surfaces can also be used in the same program.

Pygcurse also provides some additional features that curses normally doesn't, such as tinting, shadows, textboxes, and line drawing functions.

Pygcurse requires Pygame to be installed. Pygame can be downloaded from Pygcurse can be used with either Python 2 or Python 3.

Read More

I am Boycotting Amazon for the Holidays

I wrote a book to teach kids and beginners computer programming by making games entitled, “Invent Your Own Computer Games with Python”. After a few months of distributing it online for free, I began to use the print-on-demand service at (owned by to self-publish the book. I continue to make the book available for free online ( at ), but it was nice to receive a form of compensation I could buy burritos with. continues to be a great service, and it makes it easy to publish on But after has expelled WikiLeaks from its web hosting service, I have decided to pull my book from Amazon and boycott their site for the holiday season.

I encourage others to do the same.

Disabling the sale of Invent with Python

“Invent with Python” will probably still be for sale on Amazon via third party dealers with used copies, but I’ve instructed the to disable selling new copies of the book. I’ll continue to provide the full PDF online for free, because it’s always been more important to me to get it in the hands of readers than to make a buck off of it. (That, and dividing the not insignificant amount of money I’ll make from it by the very, very significant number of hours I put into it would be too depressing.)

In a way, this is an easy decision for me to make. I’m not dependent on book sales to provide me with a living, and boycotting for the holidays will only be an inconvenience. But this makes it all the more important that I don’t simply follow the easy path of silent complicity.

It will cost me over a grand this month to not sell my book, but it will cost Amazon (by my estimates) twice as much. In the end though, it probably hurts me more than it affects a multi-billion dollar company like Amazon. But I feel it’s the right thing to do, and that often doesn’t come cheap.

There are alternatives to the online giant, and I’ll be taking a look at Powell’s Books, Half-Price Books, Borders, Barnes and Noble, Biblio and others for gifts this year.

I understand that Amazon has a duty to its shareholders to protect its business interests and entangling itself with powerful political cronies does not help its bottom line. But this is why it is up to us to make defending freedom of speech one of its business interests. Amazon’s own claims that it pulled WikiLeaks for violation of its Terms of Services and not due to political pressure are equally lame and preposterous. We must vote with our voices and our pocketbooks, and I hope to set an example for others with my actions.

I’d like to thank Daniel Ellsberg (of the Pentagon Papers fame) for his call to boycott.

EDIT: Here's is an interesting and relevant link: Wikileaks Has Committed No Crime

EDIT (12/10): Damn it. I checked my createspace account this morning and found that even though I had the "extended distribution" (i.e. wholesale) channel disabled, they still sold 32 books to someone. I'll be donating the proceeds from that to WikiLeaks. I haven't seen any other sales aside from those.

Read More