UPDATE: I’ve had to stop this offer since I’ve been flooded with emails! Thank you so much!
I’m mailing out a free copy of my books to anyone who writes an Amazon review of my books (available online for free at inventwithpython.com). This is no-strings-attached: even writing a 1-star review will get you a book. Due to shipping costs, this offer is only available to US residents for now.
(UPDATE: And to clarify, the book would be sent out after your review is posted. The ebook versions are freely available and identical in content to the physical books. Due to the low response rate when I’ve previously sent out review copies first, I can’t really afford to send out books before the reviews are written. Sorry.)
The process is:
- Have an Amazon account, or someone who can post your review on their Amazon account.
- Send me an email to [email protected] to tell me you intend to write a review and of which books.
- Read the book! Free ebook versions can be read at inventwithpython.com. Take your time, there’s no deadline to read the books, but within a month or two would be nice. Or, if you’ve already read the books, just go ahead and…
- Write a review on Amazon at least 200 words. Give it an honest rating.
- Email me again with a link to the review and your mailing address.
- I’ll mail you the physical book, no matter how high or low your rating and review were.
I can send out a max of one copy of each book you write a review for, but you can write reviews for as many of the books as you want. Thank you very much in advance!
Invent Your Own Computer Games with Python, 2nd Edition [PDF]
Making Games with Python & Pygame [PDF]
Hacking Secret Ciphers with Python [PDF]
I was interviewed on the aGupieWare blog about my latest book, “Hacking Secret Ciphers with Python”.
I’ve created a series of video screencast tutorials for Scratch. Scratch is a block-based programming environment from MIT. It is a programming education toy that is made for kids between the ages of 8 and 16. The screencasts can be found at:
“Invent with Scratch” Screencast at http://inventwithscratch.com
Scratch itself is hosted at http://scratch.mit.edu
I highly recommend Scratch as a teaching tool for younger kids who may not be ready for Python programming or are frustrated by their slow typing. Scratch is a drag-and-drop environment with code “blocks” that snap together.
A text-style game is a common project for beginner programmers. These can be fun to do, but also require spending time up-front to design it is worthwhile. Before you start designing your own game, look at the design decisions of a few different text-style game genres.
Also known as interactive fiction or IF, a text adventure game were the first incarnations of these types of games. They are single-player, turn-based (the game paused while the player typed in commands), and presented the user with an English text description of each room the player was in. The player was often a single character with an inventory of items picked up in the rooms. Commands were simple English phrases like
"open door" or
West of House
You are standing in an open field west
of a white house, with a boarded front
There is a small mailbox here.
> open mailbox
While the player could die, often the player did not have stats such as hit points, money, or experience points. Text adventures are puzzle-based (such as finding different rooms or figuring out which items to use where), rather than based on progressing in stats or levels.
Text adventure games are more than just “Choose Your Own Adventure” programs, because they take place in open sandbox worlds that the player can freely explore.
These are the simplest types of games to make. In fact, you don’t even need a real programming language to make one of these games. There is software specifically for creating text adventure games.
The 1993 hit Myst is an example of a graphical version of this genre. These games became more sophisticated with the graphic adventure game genre (or “point-and-click adventure games”), the most notable coming from LucasArts. Specialized software for making graphic adventure games also exists, chief of which is Adventure Game Studio.
- Player directly controls a single character
- English text descriptions (not ASCII art)
- English phrases for commands
- No stats or levels
- Puzzle-based and role-playing story elements
I’ve been meaning to add forums to the website where readers of the programming books could talk to each other and ask questions. I’ve held off on doing this for a while until I could figure out a way to handle spam. However, I’ve decided instead to set up a subreddit for all three books (in effect, making Reddit the host for the forums).
Feel free to email me any questions you have as always, but these forums are also now available to use:
The code for this tutorial can be downloaded here: threadworms.py or from GitHub. This code works with Python 3 or Python 2, and you need Pygame installed as well in order to run it.
Click the animated gif to view a larger version.
This is a tutorial on threads and multithreaded programs in Python, aimed at beginning programmers. It helps if you know the basics of classes (what they are, how you define methods, and that methods always have self as the first parameter, what subclasses (i.e. child classes) are and how a method can be inherited from a parent class, etc.) Here’s a more in-depth classes tutorial.
The example used is a “Nibbles” or “Snake” style clone that has multiple worms running around a grid-like field, with each worm running in a separate thread.