# pygame

Python multimedia library for code\-driven games using SDL\-based graphics, input and audio\.

ID: Q576 · Revision: 624

Type: software · License: LGPL\-2\.1 for pygame; dependency licenses are separate and bundled example programs are public domain\.[^repo] · Status: active

Website: https://www.pygame.org/



pygame is a Python library for games and multimedia applications built on SDL and related libraries\. It provides image surfaces, drawing, input events, sound and optional sprite\-management helpers while leaving the main loop under application control\. This article covers the upstream pygame distribution, distinct from the separately maintained pygame\-ce fork\.[^repo][^quick][^ce]

## Capabilities and substitutions

### Surface\-based 2D graphics — supported

Surfaces represent images and support blitting, clipping, transparency and pixel manipulation\.[^surface]

Use case: Building code\-driven 2D games and multimedia applications in Python · Platforms: Windows, macOS, Linux · Region: Version, build and integration requirements apply

### Application\-controlled loop — supported

The application explicitly processes events, updates behavior, draws and presents frames\.[^quick][^events]

Use case: Building code\-driven 2D games and multimedia applications in Python · Platforms: Windows, macOS, Linux · Region: Version, build and integration requirements apply

### Sprite grouping and collision queries — supported

Optional Sprite and Group classes provide organization and rectangle, circle or mask collision helpers\.[^sprites]

Use case: Building code\-driven 2D games and multimedia applications in Python · Platforms: Windows, macOS, Linux · Region: Version, build and integration requirements apply

### Sound effects and music — limited

The optional SDL\_mixer\-backed module requires initialization and available dependencies; music has a separate streaming path\.[^audio]

Use case: Building code\-driven 2D games and multimedia applications in Python · Platforms: Windows, macOS, Linux · Region: Version, build and integration requirements apply

### [Substitute for pygame\-ce](/pygamece) — limited

Assessment: an alternative for Python 2D projects that only need the shared pygame\-style APIs\. CE\-specific additions are not established as available upstream, and the two distributions must not be treated as independent co\-installable providers of different import namespaces\.[^quick][^ce][^ce-install]

Use case: Building code\-driven 2D games and multimedia applications in Python · Platforms: Windows, macOS, Linux · Region: Version, build and integration requirements apply

## References

[^repo]: [pygame README](<https://github.com/pygame/pygame/blob/main/README.rst>) — Scope, installation, documentation versions, dependencies and licensing (vendor; retrieved 2026-10-07T20:00:21Z)

[^quick]: [pygame documentation](<https://www.pygame.org/docs/>) — Application\-controlled game loop and module overview (vendor; retrieved 2026-10-07T19:53:52Z)

[^surface]: [pygame Surface reference](<https://www.pygame.org/docs/ref/surface.html>) — Images, blitting, clipping, pixel access and shared subsurfaces (vendor; retrieved 2026-10-07T19:59:56Z)

[^events]: [pygame event reference](<https://www.pygame.org/docs/ref/event.html>) — Queue capacity, per\-frame handling and display\-thread restrictions (vendor; retrieved 2026-10-07T20:00:09Z)

[^sprites]: [pygame sprite reference](<https://www.pygame.org/docs/ref/sprite.html>) — Optional Sprite/Group classes and collision helpers (vendor; retrieved 2026-10-07T20:01:02Z)

[^audio]: [pygame mixer reference](<https://www.pygame.org/docs/ref/mixer.html>) — Optional mixer, channels, background playback and streaming music (vendor; retrieved 2026-10-07T20:01:02Z)

[^ce]: [pygame\-ce README](<https://github.com/pygame-community/pygame-ce/blob/main/README.rst>) — Separate fork and Python multimedia scope (vendor; retrieved 2026-10-07T20:00:21Z)

[^ce-install]: [Installing pygame\-ce](<https://github.com/pygame-community/pygame-ce/wiki/Installing-pygame%E2%80%90ce>) — Conflicting package installation and isolated environments (vendor; retrieved 2026-10-07T20:00:50Z)

Source revision: https://substitutefor.net/entities/Q576?revision=624
