Posts categorized “News”.

New Book: “Making Games with Python & Pygame”

I've completed my next book, which focuses on the Pygame library and making graphical games in Python. It assumes you have a little bit of Python programming knowledge. The book is free to read online from http://inventwithpython.com/pygame and can also be bought on Amazon.com for $25.

Thanks to everyone who helped me out with this book over the last year and a half.

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.

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.

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 http://pygame.org. Pygcurse can be used with either Python 2 or Python 3.

1000th Book Sold!

I'd just like to announce that "Invent Your Own Computer Games with Python" has just sold its 1000th hard copy since it's gone on sale last May. I'd like to say a general thanks to everyone who has found this book useful. Thank you!

If you like the book, it would be great if you could write a review for it on its page on Amazon.com.

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 CreateSpace.com (owned by Amazon.com) to self-publish the book. I continue to make the book available for free online ( at http://inventwithpython.com ), but it was nice to receive a form of compensation I could buy burritos with.

CreateSpace.com continues to be a great service, and it makes it easy to publish on Amazon.com. But after Amazon.com 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 CreateSpace.com 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 Amazon.com 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.