Navigate:
All Repospygame
~$PYGAME0.1%

pygame: Python library for multimedia applications

Python wrapper for SDL enabling 2D game development.

LIVE RANKINGS • 06:51 AM • STEADY
OVERALL
#120
59
DEVELOPER TOOLS
#21
12
30 DAY RANKING TREND
ovr#120
·Devel#21
STARS
8.6K
FORKS
4.0K
DOWNLOADS
7D STARS
+13
7D FORKS
+2
See Repo:
Share:

Learn more about pygame

pygame is a Python library that wraps the Simple DirectMedia Layer (SDL) library along with other dependencies to provide abstractions for multimedia programming. It is implemented in a combination of C and Python, with native and OpenGL support for rendering. The library offers modules for 2D graphics, sprite management, collision detection, audio playback in multiple formats (WAV, MP3, OGG), and input handling from keyboards, mice, and joysticks. It is commonly used for developing 2D games, interactive applications, and educational projects in Python.


1

SDL-based abstraction

Built on top of SDL, pygame provides a higher-level Python interface to low-level multimedia functions while maintaining cross-platform compatibility across Windows, macOS, and Linux.

2

Integrated sprite and collision systems

Includes built-in sprite management and collision detection utilities specifically designed for game development, reducing boilerplate code for common game mechanics.

3

Multi-format audio support

Supports WAV, MP3, and OGG audio formats for both sound effects and background music, with functions for playback and manipulation.


import pygame

pygame.init()
screen = pygame.display.set_mode((800, 600))
clock = pygame.time.Clock()

player_pos = [400, 300]
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    
    player_pos[0] += 2
    screen.fill((0, 0, 0))
    pygame.draw.circle(screen, (255, 0, 0), player_pos, 25)
    pygame.display.flip()
    clock.tick(60)

v2.6.1

Bugfix release adding Python 3.13 support; pins Cython version range and removes PyPy 3.7.

  • Upgrade to Python 3.13 when available; Windows builds now include 3.13 support.
  • Pin Cython to a specific version range if building from source; old PyPy 3.7 support removed.
v2.6.0

Maintenance release adding Python 3.12 support, bumping SDL to 2.28.4, and removing experimental Windows camera backend; no breaking changes documented.

  • Upgrade to SDL 2.28.4 for manylinux and Windows prebuilt dependencies to pick up upstream fixes.
  • Remove experimental camera_windows backend; verify camera functionality if you relied on Windows camera support.
v2.6.0.dev2

Pre-release for testing only; release notes do not specify breaking changes, requirements, or new features.

  • Install with `python -m pip install pygame==2.6.0.dev2` for testing purposes only.
  • Consult https://github.com/pygame/pygame/issues for known issues; production use is not recommended.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers