Resources

On the Web

kenney.nl: large collection of free assets for building computer games

docs.python.org: everything you could possibly need to know about Python programming

pygame.org: a complete reference for pygame

Books

Think Python by Allen B. Downey is an introduction to Python programming for beginners. The full text of the book is available online.

There are useful examples in in Making Games with Python & Pygame by Al Sweigart. The whole book is available for reading online or as a PDF.

Your Laptop

In summer 2026, our laptop computers are the following make and model: Dell 15 DC15250. The service manual is here.

Walker Images for Download

These images are from kenney.nl: walker-images.zip

Quitter

The minimal seed of a pygame.

quitter.py
import pygame

# pygame initialization
pygame.init()
clock = pygame.time.Clock()

background_color = (30,144,255) # change this to whatever you like

window = pygame.display.set_mode((800,600))
window.fill(background_color)

# set window title
pygame.display.set_caption("q to quit")
pygame.display.update()

data = {}

def redraw():
    window.fill(background_color)
    pygame.display.update()
    
def run_app():
    app_is_running = True
    while app_is_running==True:  
        for event in pygame.event.get():
            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_q:
                    app_is_running = False
            elif event.type == pygame.QUIT: # this is for the quit button
                app_is_running = False
        redraw()
        clock.tick(24)
    pygame.quit()

run_app()

Uno Seed Code

The beginnings of a pygame implementation of Uno.

uno.py
import pygame

# ================

class UnoCard:

    def __init__(self, color, number):
        self.color = color
        self.number = number

    def __str__(self):
        return "[" + self.color + " " + str(self.number) + "]"

# ================

# pygame initialization
pygame.init()
clock = pygame.time.Clock()

background_color = (30,144,255) # change this to whatever you like

window = pygame.display.set_mode((800,600))
window.fill(background_color)

# set window title
pygame.display.set_caption("q to quit")
pygame.display.update()

data = {}

def redraw():
    window.fill(background_color)
    pygame.display.update()
    
def run_app():
    app_is_running = True
    while app_is_running==True:  
        for event in pygame.event.get():
            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_q:
                    app_is_running = False
            elif event.type == pygame.QUIT: # this is for the quit button
                app_is_running = False
        redraw()
        clock.tick(24)
    pygame.quit()

run_app()

Pygame Key Constants

ConstantKeyDescription
K_BACKSPACE\bbackspace
K_TAB\ttab
K_CLEAR clear
K_RETURN\rreturn
K_PAUSE pause
K_ESCAPE^[escape
K_SPACE space
K_EXCLAIM!exclaim
K_QUOTEDBL"quotedbl
K_HASH#hash
K_DOLLAR$dollar
K_AMPERSAND&ampersand
K_QUOTE quote
K_LEFTPAREN(left parenthesis
K_RIGHTPAREN)right parenthesis
K_ASTERISK*asterisk
K_PLUS+plus sign
K_COMMA,comma
K_MINUS-minus sign
K_PERIOD.period
K_SLASH/forward slash
K_000
K_111
K_222
K_333
K_444
K_555
K_666
K_777
K_888
K_999
K_COLON:colon
K_SEMICOLON;semicolon
K_LESS<less-than sign
K_EQUALS=equals sign
K_GREATER>greater-than sign
K_QUESTION?question mark
K_AT@at
K_LEFTBRACKET[left bracket
K_BACKSLASH\backslash
K_RIGHTBRACKET]right bracket
K_CARET^caret
K_UNDERSCORE_underscore
K_BACKQUOTE`grave
K_aaa
ConstantKeyDescription
K_bbb
K_ccc
K_ddd
K_eee
K_fff
K_ggg
K_hhh
K_iii
K_jjj
K_kkk
K_lll
K_mmm
K_nnn
K_ooo
K_ppp
K_qqq
K_rrr
K_sss
K_ttt
K_uuu
K_vvv
K_www
K_xxx
K_yyy
K_zzz
K_DELETE delete
K_KP0 keypad 0
K_KP1 keypad 1
K_KP2 keypad 2
K_KP3 keypad 3
K_KP4 keypad 4
K_KP5 keypad 5
K_KP6 keypad 6
K_KP7 keypad 7
K_KP8 keypad 8
K_KP9 keypad 9
K_KP_PERIOD.keypad period
K_KP_DIVIDE/keypad divide
K_KP_MULTIPLY*keypad multiply
K_KP_MINUS-keypad minus
K_KP_PLUS+keypad plus
K_KP_ENTER\rkeypad enter
K_KP_EQUALS=keypad equals
K_UP up arrow
K_DOWN down arrow
ConstantKeyDescription
K_RIGHT right arrow
K_LEFT left arrow
K_INSERT insert
K_HOME home
K_END end
K_PAGEUP page up
K_PAGEDOWN page down
K_F1 F1
K_F2 F2
K_F3 F3
K_F4 F4
K_F5 F5
K_F6 F6
K_F7 F7
K_F8 F8
K_F9 F9
K_F10 F10
K_F11 F11
K_F12 F12
K_F13 F13
K_F14 F14
K_F15 F15
K_NUMLOCK numlock
K_CAPSLOCK capslock
K_SCROLLOCK scrollock
K_RSHIFT right shift
K_LSHIFT left shift
K_RCTRL right control
K_LCTRL left control
K_RALT right alt
K_LALT left alt
K_RMETA right meta
K_LMETA left meta
K_LSUPER left Windows key
K_RSUPER right Windows key
K_MODE mode shift
K_HELP help
K_PRINT print screen
K_SYSREQ sysrq
K_BREAK break
K_MENU menu
K_POWER power
K_EURO Euro
K_AC_BACK Android back button

PDFs