




























































































Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!





























































































Program Arcade
Games
This book is dedicated to everyone who loves to learn.
Contents at a Glance
About the Author ����������������������������������������������������������������������������������������������������xix
Contents
About the Author ����������������������������������������������������������������������������������������������������xix
viii
x
xi
xiii
xiv
xvi
xvii
xxi
Introduction
It all started in 1983 when my dad, who was also a teacher, bought an Apple //e computer for our use at home. Since it was to be “dad’s computer” for educational purposes only, my brother and I were not allowed to purchase any games. So, at the local library I found two programming books by David H. Ahl: BASIC Computer Games and More BASIC Computer Games. These books had code I could use to type in and run my own games. This was the beginning of my creative outlet with computers. As a computer science professor, I have found getting other people to program their own games as a great way to foster interest in computer science. Unfortunately, back when I started teaching students this way, the type of book I started with in the 1980s did not seem to be available any longer. I wanted to help others learn to program the same way I started. To provide a textbook for my students, I began to write my own programming book. I started the website ProgramArcadeGames.com in 2009. The book you have in your hand morphed from the materials on that website and from student input from my beginning computer programming classes. I would like to acknowledge and thank everyone who took time to give feedback, no matter how large or small. This book is the product of hundreds of students I have worked with personally, and the feedback of hundreds of people on-line. I continue to develop the website and use this book to share my love of programming with others.
1
Before Getting Started…
This introductory chapter has two parts:
Installing and Starting Python To get started, two programs need to be installed: Python and Pygame. Python is the computer language we will program in, and Pygame is a library of commands that will help make writing games easier.
If you are working with a computer that already has Python and Pygame set up on it, you can skip this step. But if you want to set up Python and Pygame on your own Windows computer, don’t worry. It is very easy.