© Sloan Kelly  2019
Sloan KellyPython, PyGame, and Raspberry Pi Game Developmenthttps://doi.org/10.1007/978-1-4842-4533-0_9

9. Basic Introduction to PyGame

Sloan Kelly1 
Niagara Falls, ON, Canada

PyGame is a free framework for Python that provides modules designed to write video games. It is built on top of the Simple DirectMedia Layer Library (SDL) that provides easy access to sound and visual elements.

In this section we will see how to set up PyGame and look at some of the elements that will be used in our future programs. The Python language does not include PyGame, and as such the framework must be imported before it can be used.

Importing the PyGame Framework

Importing a module in Python is through the ‘import’ keyword. To import PyGame you ...

Get Python, PyGame, and Raspberry Pi Game Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.