Python Tutorial

This intermediate tutorial focuses on teaching you the core features of the Python programming language and using a free library called pygame to create 2D video games.  Game programming provides all the same challenges as other kinds of programming, but games are also visual and interactive which I think helps to motivate students new to the field.   While it helps if you have had some exposure to coding before (e.g., p5.js), you’ll find that these notes review all of the basic concepts of programming from scratch.

1.0 Getting Started with Python

1-1 Tools for Success

1-6 Hello Python!

1-7 Code Commenting

1-8 Input, Processing, Output (IPO)

1-9 Writing Simple Functions

1-10 Passing Data to Functions

1-11 Returning Data from Functions

1-12 Types of Errors

2.0 Python Fundamentals

2-1 Decision Structures

2-2 Boolean Logic

2-3 Conditional Loops

2-4 Counted Loops

2-5 More On Loops.. More On Loops..

2-6 Random Numbers

2-7 Making a Simple Text Game

2-8 Modules

3.0 Advanced Python

3-3 Exceptions

3-4 Strings

3-5 String Methods

3-6 Lists

3-7 Odds and Ends

3-9 Creating a Tic-Tac-Toe Game

3-11 Searching and Sorting

4.0 Object-Oriented Programming (OOP) and Pygame

4-1 What is Object-Oriented Programming?

4-2 Classes and Objects

4-3 Inheritance and Polymorphism

4-4 Getting Started with Pygame

4-5 Drawing with Pygame

4-6 Images and Text

4-7 Responding to Basic Events

4-8 Music and Sound Effects

4-9 Sprites and Sprite Groups

4-10 More Sprites

4-11 Managing Collisions

4-12 Handling Joystick Events

4-13 Building a Complete Game: pyPong v1.0

4-14 pyPong v2.0