Skip to main content
Engineering LibreTexts

0.2: About This Book

  • Page ID
    14382
  • Hello! This book will teach you how to make graphical computer games with the Pygame framework (also called the Pygame library) in the Python programming language. Pygame makes it easy to create programs with 2D graphics. Both Python and the Pygame framework can be downloaded for free from http://python.org and http://pygame.org. All you need is a computer and this book to begin making your own games.

    This book is an intermediate programming book. If you are completely new to programming, you can still try to follow along with the source code examples and figure out how programming works. However, it might be easier to learn how to program in Python first. "Invent Your Own Computer Games with Python" is a book that is available completely for free from http://inventwithpython.com. That book teaches programming by making non-graphical, text-based games for complete beginners, and also has a few chapters about using the Pygame library.

    However, if you already know how to program in Python (or even some other language, since Python is so easy to pick up) and want to start making games beyond just text, then this is the book for you. The book starts with a short introduction to how the Pygame library works and the functions it provides. Then it provides the complete source code for some actual games and explains how the code works, so you can understand how actual game programs make use of Pygame.

    This book features seven different games that are clones of popular games that you’ve probably already played. The games are a lot more fun and interactive than the text-based games in "Invent with Python", but are still fairly short. All of the programs are less than 600 lines long. This is pretty small when you consider that professional games you download or buy in a store can be hundreds of thousands of lines long. These games require an entire team of programmers and artists working with each other for months or years to make.

    The website for this book is http://inventwithpython.com/pygame. All the programs and files mentioned in this book can be downloaded for free from this website, including this book itself. Programming is a great creative activity, so please share this book as widely as possible. The Creative Commons license that this book is released under gives you the right to copy and duplicate this book as much as you want (as long as you don’t charge money for it).

    If you ever have questions about how these programs work, feel free to email me at al@inventwithpython.com.