This is the old 1st edition. The new 2nd edition of "Invent Your Own Computer Games with Python" is located at http://inventwithpython.com
This is a book that will show you how to make computer games. All you need is a computer, some software called the Python Interpreter, and this book. The software is free. You can download it at no charge from the Internet. This book will show you how to set up your computer and program a few games. Once you learn how these games work, you will be able to use that knowledge to create games of your own.
When I was a kid, I found a book like this that taught me how to write my first programs and games. It was fun and easy. Now as an adult, I still have fun programming computers as a job, and I get paid for it. But even if you don't become a computer programmer when you grow up, programming is a useful and fun skill to have. (I still sometimes invent my own computer games.)
Computers are very useful machines. In the future, knowing how to program a computer may be as useful as knowing how to read a book. The good news is that learning to program isn't as hard as learning to read. If you can read this book, you can program a computer.
To tell a computer what you want it to do, that is, to program a computer, you will need to learn the computer's language. There are many different programming languages: BASIC, Java, Python, Pascal, Haskell, and C++ (pronounced, "see plus plus").
The book I read when I was a kid taught me BASIC programming. Back then, most people who started to learn programming would learn to program in BASIC. But new programming languages have been invented since then. This book is about Python programming. Python is even easier to learn than BASIC. Not only is it easy, but it is also a serious and powerful programming language. Many adults use Python in their own jobs and hobbies. That’s why I chose to make this book about Python programming.
You might want the help of an adult or someone else to download and install the Python software. The software that runs programs you write is called an interpreter. The interpreter is a program that runs programs written in the Python language. This interpreter program is called the Python interpreter (or sometimes, we just plainly call it Python). You can download the Python interpreter from this website:
http://www.python.org
Click on the Download link on the left side of the web page. On the download page, click on the Python 2.6.1 Windows Installer to download the Python interpreter for Windows. (If you are running an operating system other than Windows, download the Python installer for your operating system instead.) There may be newer versions by the time you read this book. If so, you can download the new version and the programs in this book will still work.

Double-click on the python-2.6.1.msi file that you've just downloaded. This will start the Python installer. All you need to do in the installer is click the Next button. The default choices in the installer are just fine. When the install is finished, click Finish. You may have to restart your computer. You should save any work you have in any other programs that are running, and then click "Yes". After the computer has rebooted, you will be ready to start programming!
Be sure that you do not download the 3.0 version of Python. This is a newer version of Python that contains advanced features, but is incompatible with the old 2.x versions of Python. Many advanced Python libraries do not yet support 3.0, which is why this book covers the 2.x versions.
The software you just downloaded and installed is called the Python interpreter and it runs programs you write in the Python language. When we say "Python" as in "Python runs the program", we are referring to the Python interpreter software. When we say "in Python" as in "Write the program in Python", we are referring to the Python language.
The games we'll create may seem simple compared to games you’ve played on the XBox, Playstation, or Wii. These games don’t have fancy graphics or music. But games don’t have to be very complicated to be fun. And unlike those video game consoles, you can always get more games by creating them yourself for free. All you need is a computer and this book.
Okay, let’s get started!
After you have installed the Python interpreter, you can start it by clicking on Start, then Programs, then Python 2.6, then IDLE (Python GUI). Look at this picture for an example:

You will see a new window with the title, "Python Shell". It will look like this:

This is the Interactive DeveLopment Environment (IDLE) program. IDLE is a program that helps us type in our own programs and games. This window appears when you first run IDLE and is called the interactive shell. We can type Python instructions into the shell to make the computer do what we want. A program is a whole bunch of instructions put together, like a story is made up of a whole bunch of sentences.
Let's learn some basic instructions first. We'll learn how to make the computer solve some math problems in the Python shell. Don't worry if you don't know a lot of mathematics. If you know how to add and multiply, you know enough math to do programming. Even if you aren't very good at math, programming is more about problem solving in general than it is about solving math problems.
Things Covered In This Chapter:
- Downloading and installing the Python interpreter.
- Using IDLE's interactive shell to run instructions.