© 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 
(1)
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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.