pygame 2.6.1


pip install pygame

  Latest version

Released: Sep 29, 2024


Meta
Author: A community project.
Requires Python: >=3.6

Classifiers

Development Status
  • 6 - Mature

License
  • OSI Approved :: GNU Library or Lesser General Public License (LGPL)

Programming Language
  • Assembly
  • C
  • Cython
  • Objective C
  • Python
  • Python :: 3
  • Python :: 3.6
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Topic
  • Games/Entertainment
  • Multimedia :: Sound/Audio
  • Multimedia :: Sound/Audio :: MIDI
  • Multimedia :: Sound/Audio :: Players
  • Multimedia :: Graphics
  • Multimedia :: Graphics :: Capture :: Digital Camera
  • Multimedia :: Graphics :: Capture :: Screen Capture
  • Multimedia :: Graphics :: Graphics Conversion
  • Multimedia :: Graphics :: Viewers

Operating System
  • Microsoft :: Windows
  • POSIX
  • Unix
  • MacOS
pygame

AppVeyorBuild PyPiVersion PyPiLicense Python3 GithubCommits BlackFormatBadge

Pygame is a free and open-source cross-platform library for the development of multimedia applications like video games using Python. It uses the Simple DirectMedia Layer library and several other popular libraries to abstract the most common functions, making writing these programs a more intuitive task.

We need your help to make pygame the best it can be! New contributors are welcome.

Installation

Before installing pygame, you must check that Python is installed on your machine. To find out, open a command prompt (if you have Windows) or a terminal (if you have MacOS or Linux) and type this:

python --version

If a message such as “Python 3.8.10” appears, it means that Python is correctly installed. If an error message appears, it means that it is not installed yet. You must then go to the official website to download it.

Once Python is installed, you have to perform a final check: you have to see if pip is installed. Generally, pip is pre-installed with Python but we are never sure. Same as for Python, type the following command:

pip --version

If a message such as “pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)” appears, you are ready to install pygame! To install it, enter this command:

pip install pygame

Once pygame is installed, quickly test your library by entering the following command, which opens one of the many example games that comes pre-installed:

python3 -m pygame.examples.aliens

If this doesn’t work, the Getting Started section of the official website has more information for platform specific issues, such as adding python to your machine’s PATH settings

Help

If you are just getting started with pygame, you should be able to get started fairly quickly. Pygame comes with many tutorials and introductions. There is also full reference documentation for the entire library. Browse the documentation on the docs page. You can also browse the documentation locally by running python -m pygame.docs in your terminal. If the docs aren’t found locally, it’ll launch the online website instead.

The online documentation stays up to date with the development version of pygame on GitHub. This may be a bit newer than the version of pygame you are using. To upgrade to the latest full release, run pip install pygame --upgrade in your terminal.

Best of all, the examples directory has many playable small programs which can get you started playing with the code right away.

Features

Pygame is a powerful library for game development, offering a wide range of features to simplify your coding journey. Let’s delve into what pygame has to offer:

Graphics - With pygame, creating dynamic and engaging graphics has never been easier. The library provides simple yet effective tools for 2D graphics and animation, including support for images, rectangles, and polygon shapes. Whether you’re a seasoned game developer or just starting out, pygame has you covered.

Sound - Pygame also includes support for playing and manipulating sound and music, making it easy to add sound effects and background music to your games. With support for WAV, MP3, and OGG file formats, you have plenty of options to choose from.

Input - Pygame provides intuitive functions for handling keyboard, mouse, and joystick input, allowing you to quickly and easily implement player controls in your games. No more struggling with complex input code, pygame makes it simple.

Game Development - Lastly, pygame provides a comprehensive suite of tools and features specifically designed for game development. From collision detection to sprite management, pygame has everything you need to create exciting and engaging games. Whether you’re building a platformer, puzzle game, or anything in between, pygame has you covered.

Building From Source

If you want to use features that are currently in development, or you want to contribute to pygame, you will need to build pygame locally from its source code, rather than pip installing it.

Installing from source is fairly automated. The most work will involve compiling and installing all the pygame dependencies. Once that is done, run the setup.py script which will attempt to auto-configure, build, and install pygame.

Much more information about installing and compiling is available on the Compilation wiki page.

Contribute

Credits

Thanks to everyone who has helped contribute to this library. Special thanks are also in order.

  • Marcus Von Appen: many changes, and fixes, 1.7.1+ freebsd maintainer

  • Lenard Lindstrom: the 1.8+ windows maintainer, many changes, and fixes

  • Brian Fisher for svn auto builder, bug tracker and many contributions

  • Rene Dudfield: many changes, and fixes, 1.7+ release manager/maintainer

  • Phil Hassey for his work on the pygame.org website

  • DR0ID for his work on the sprite module

  • Richard Goedeken for his smoothscale function

  • Ulf Ekström for his pixel perfect collision detection code

  • Pete Shinners: original author

  • David Clark for filling the right-hand-man position

  • Ed Boraas and Francis Irving: Debian packages

  • Maxim Sobolev: FreeBSD packaging

  • Bob Ippolito: MacOS and OS X porting (much work!)

  • Jan Ekhol, Ray Kelm, and Peter Nicolai: putting up with early design ideas

  • Nat Pryce for starting our unit tests

  • Dan Richter for documentation work

  • TheCorruptor for his incredible logos and graphics

  • Nicholas Dudfield: many test improvements

  • Alex Folkner for pygame-ctypes

Thanks to those sending in patches and fixes: Niki Spahiev, Gordon Tyler, Nathaniel Pryce, Dave Wallace, John Popplewell, Michael Urman, Andrew Straw, Michael Hudson, Ole Martin Bjoerndalen, Herve Cauwelier, James Mazer, Lalo Martins, Timothy Stranex, Chad Lester, Matthias Spiller, Bo Jangeborg, Dmitry Borisov, Campbell Barton, Diego Essaya, Eyal Lotem, Regis Desgroppes, Emmanuel Hainry, Randy Kaelber Matthew L Daniel, Nirav Patel, Forrest Voight, Charlie Nolan, Frankie Robertson, John Krukoff, Lorenz Quack, Nick Irvine, Michael George, Saul Spatz, Thomas Ibbotson, Tom Rothamel, Evan Kroske, Cambell Barton.

And our bug hunters above and beyond: Angus, Guillaume Proux, Frank Raiser, Austin Henry, Kaweh Kazemi, Arturo Aldama, Mike Mulcheck, Michael Benfield, David Lau

There’s many more folks out there who’ve submitted helpful ideas, kept this project going, and basically made our life easier. Thanks!

Many thank you’s for people making documentation comments, and adding to the pygame.org wiki.

Also many thanks for people creating games and putting them on the pygame.org website for others to learn from and enjoy.

Lots of thanks to James Paige for hosting the pygame bugzilla.

Also a big thanks to Roger Dingledine and the crew at SEUL.ORG for our excellent hosting.

Dependencies

Pygame is obviously strongly dependent on SDL and Python. It also links to and embeds several other smaller libraries. The font module relies on SDL_ttf, which is dependent on freetype. The mixer (and mixer.music) modules depend on SDL_mixer. The image module depends on SDL_image, which also can use libjpeg and libpng. The transform module has an embedded version of SDL_rotozoom for its own rotozoom function. The surfarray module requires the Python NumPy package for its multidimensional numeric arrays. Dependency versions:

CPython

>= 3.6 (Or use PyPy3)

SDL

>= 2.0.8

SDL_mixer

>= 2.0.0

SDL_image

>= 2.0.2

SDL_ttf

>= 2.0.11

SDL_gfx

(Optional, vendored in)

NumPy

>= 1.6.2 (Optional)

License

This library is distributed under GNU LGPL version 2.1, which can be found in the file docs/LGPL.txt. We reserve the right to place future versions of this library under a different license.

This basically means you can use pygame in any project you want, but if you make any changes or additions to pygame itself, those must be released with a compatible license (preferably submitted back to the pygame project). Closed source and commercial games are fine.

The programs in the examples subdirectory are in the public domain.

See docs/licenses for licenses of dependencies.

2.6.1 Sep 29, 2024
2.6.0 Jun 25, 2024
2.6.0.dev2 Jun 23, 2024
2.5.2 Sep 17, 2023
2.5.1 Aug 14, 2023
2.5.0 Jun 24, 2023
2.5.0.dev2 Jun 10, 2023
2.4.0 Apr 30, 2023
2.4.0.dev2 Mar 20, 2023
2.3.0 Mar 14, 2023
2.3.0.dev2 Mar 04, 2023
2.2.0 Feb 28, 2023
2.2.0.dev2 Feb 23, 2023
2.1.3 Feb 14, 2023
2.1.3.dev8 Oct 16, 2022
2.1.3.dev6 Oct 01, 2022
2.1.3.dev5 Oct 01, 2022
2.1.2 Dec 27, 2021
2.1.1 Dec 24, 2021
2.1.1.dev4 Dec 24, 2021
2.1.1.dev2 Dec 22, 2021
2.1.0 Nov 07, 2021
2.1.0.dev2 Nov 07, 2021
2.0.3 Oct 31, 2021
2.0.3.dev6 Oct 31, 2021
2.0.3.dev4 Oct 24, 2021
2.0.2 Oct 10, 2021
2.0.2.dev4 Oct 09, 2021
2.0.1 Dec 24, 2020
2.0.1.dev1 Dec 23, 2020
2.0.0 Oct 28, 2020
2.0.0.dev24 Oct 27, 2020
2.0.0.dev22 Oct 23, 2020
2.0.0.dev20 Oct 22, 2020
2.0.0.dev18 Oct 21, 2020
2.0.0.dev16 Oct 20, 2020
2.0.0.dev14 Oct 11, 2020
2.0.0.dev12 Sep 19, 2020
1.9.6 Apr 25, 2019
1.9.6rc2 Apr 19, 2019
1.9.6rc1 Apr 16, 2019
1.9.5 Mar 31, 2019
1.9.5rc2 Mar 29, 2019
1.9.5rc1 Mar 24, 2019
1.9.5.dev0 Aug 03, 2018
1.9.4 Jul 19, 2018
1.9.4rc1 Jul 19, 2018
1.9.4.dev0 Mar 24, 2018
1.9.3 Jan 16, 2017
1.9.2 Dec 13, 2016
1.9.2rc1 Dec 05, 2016
1.9.2b8 Aug 05, 2016
1.9.2b7 Jul 31, 2016
1.9.2b6 Jul 21, 2016
1.9.2b5 Jul 20, 2016
1.9.2b4 Jul 18, 2016
1.9.2b1 Jul 15, 2016
1.9.2.dev1 Jul 24, 2016

Wheel compatibility matrix

Platform CPython 3.6 CPython 3.7 CPython 3.8 CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13 PyPy 3.6 (pp73) PyPy 3.8 (pp73) PyPy 3.9 (pp73)
macosx_10_13_x86_64
macosx_10_15_x86_64
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux2014_aarch64
manylinux2014_i686
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_i686
manylinux_2_17_x86_64
win32
win_amd64

Files in release

pygame-2.6.1-cp310-cp310-macosx_10_9_x86_64.whl (12.5MiB)
pygame-2.6.1-cp310-cp310-macosx_11_0_arm64.whl (11.8MiB)
pygame-2.6.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp310-cp310-win32.whl (9.8MiB)
pygame-2.6.1-cp310-cp310-win_amd64.whl (10.1MiB)
pygame-2.6.1-cp311-cp311-macosx_10_9_x86_64.whl (12.5MiB)
pygame-2.6.1-cp311-cp311-macosx_11_0_arm64.whl (11.8MiB)
pygame-2.6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp311-cp311-win32.whl (9.8MiB)
pygame-2.6.1-cp311-cp311-win_amd64.whl (10.1MiB)
pygame-2.6.1-cp312-cp312-macosx_10_9_x86_64.whl (12.5MiB)
pygame-2.6.1-cp312-cp312-macosx_11_0_arm64.whl (11.8MiB)
pygame-2.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp312-cp312-win32.whl (9.8MiB)
pygame-2.6.1-cp312-cp312-win_amd64.whl (10.1MiB)
pygame-2.6.1-cp313-cp313-macosx_10_13_x86_64.whl (12.5MiB)
pygame-2.6.1-cp313-cp313-macosx_11_0_arm64.whl (11.8MiB)
pygame-2.6.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp313-cp313-win32.whl (9.8MiB)
pygame-2.6.1-cp313-cp313-win_amd64.whl (10.1MiB)
pygame-2.6.1-cp36-cp36m-macosx_10_9_x86_64.whl (12.5MiB)
pygame-2.6.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp36-cp36m-win32.whl (9.9MiB)
pygame-2.6.1-cp36-cp36m-win_amd64.whl (10.3MiB)
pygame-2.6.1-cp37-cp37m-macosx_10_9_x86_64.whl (12.5MiB)
pygame-2.6.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp37-cp37m-win32.whl (9.9MiB)
pygame-2.6.1-cp37-cp37m-win_amd64.whl (10.3MiB)
pygame-2.6.1-cp38-cp38-macosx_10_9_x86_64.whl (12.4MiB)
pygame-2.6.1-cp38-cp38-macosx_11_0_arm64.whl (11.8MiB)
pygame-2.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp38-cp38-win32.whl (9.8MiB)
pygame-2.6.1-cp38-cp38-win_amd64.whl (10.1MiB)
pygame-2.6.1-cp39-cp39-macosx_10_9_x86_64.whl (12.4MiB)
pygame-2.6.1-cp39-cp39-macosx_11_0_arm64.whl (11.8MiB)
pygame-2.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.0MiB)
pygame-2.6.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (13.6MiB)
pygame-2.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3MiB)
pygame-2.6.1-cp39-cp39-win32.whl (9.8MiB)
pygame-2.6.1-cp39-cp39-win_amd64.whl (10.1MiB)
pygame-2.6.1-pp36-pypy36_pp73-win32.whl (9.9MiB)
pygame-2.6.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (12.2MiB)
pygame-2.6.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl (12.2MiB)
pygame-2.6.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (13.5MiB)
pygame-2.6.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.2MiB)
pygame-2.6.1.tar.gz (14.1MiB)
No dependencies