Introduction to PyGame (2017)

About

There are many places where you can get started if you want to learn about game development. If you’re interested in the programming side of things, but want to make graphical games instead of text-based console games, then PyGame is a great place to start out.

If you’re familiar with C++, Java, or C#, Python looks different but it still has the basics – variables, if statements, loops, functions, classes, and inheritance.

This tutorial is meant to show you the basics of using Python and PyGame together, and at the end you will iteratively build your own version of the game Pickin’ Sticks.


 

Introduction to PyGame

Last updated August, 2017, by Rachel Morris

Creative Commons License Introduction to Mobile Game Development by Rachel J. Morris is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Based on a work at http://www.moosader.com/introduction-to-pygame-2017/


 

Contents

1. Setting up Python & PyGame
Downloading and installing Python and PyGame

2. Introduction, Class Files, & Glossary
Basic terminology and information

3. Basics: Importing PyGame and Creating the window
The bare-minimum required for a PyGame program

4. Basics: Loading and displaying images

5. Basics: Loading and playing audio

6. Basics: Loading fonts and displaying text

7. Basics: Getting keyboard and mouse input

8. Pickin’ Sticks Iteration 1
Randomly placing items to collect, click to pick ’em!

9. Pickin’ Sticks Iteration 2
Using the keyboard to move a character around the screen.

10. Pickin’ Sticks Iteration 3
Adding an enemy to the game who moves on its own.

Print Friendly