O'Reilly logo

Getting Started with Raspberry Pi by Shawn Wallace, Matt Richardson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Animation and Multimedia in Python

Pygame is a lightweight framework for creating simple games in Python. You can also think of it as a tool for general multimedia programming; it’s a convenient way to just draw graphics on the screen, play sounds, or handle keyboard and mouse events.

Pygame is a software wrapper around another library called the Simple DirectMedia Layer (SDL). SDL handles all of the low-level access to the Pi’s keyboard, mouse, audio drivers and video drivers. Pygame simplifies SDL even further.

This focus of this chapter is more on the basic multimedia capabilities of Pygame, rather than a tutorial on game programming. Other resources for game programming are provided at the end.

Hello Pygame

Pygame comes pre-installed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required