Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🐍🎮 pygame (the library) is a Free and Open Source python programming language library for making multimedia applications like games built on top of the excellent SDL library. C, Python, Native, OpenGL.

NotificationsYou must be signed in to change notification settings

pygame/pygame

Repository files navigation

pygame

AppVeyorBuildPyPiVersionPyPiLicensePython3GithubCommitsBlackFormatBadge

Pygame is a free and open-source cross-platform libraryfor the development of multimedia applications like video games using Python.It uses theSimple DirectMedia Layer library and several otherpopular libraries to abstract the most common functions, making writingthese 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 installedon your machine. To find out, open a command prompt (if you haveWindows) 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 Pythonis correctly installed. If an error message appears, it means thatit is not installed yet. You must then go to theofficial website to download it.

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

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 installit, enter this command:

pip install pygame

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

python3 -m pygame.examples.aliens

If this doesn’t work, theGetting Started section of the officialwebsite has more information for platform specific issues, such as addingpython to your machine’s PATH settings

Help

If you are just getting started with pygame, you should be able toget started fairly quickly. Pygame comes with many tutorials andintroductions. There is also full reference documentation for theentire library. Browse the documentation on thedocs page. Youcan also browse the documentation locally by runningpython -m pygame.docs in your terminal. If the docs aren't foundlocally, it'll launch the online website instead.

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

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

Features

Pygame is a powerful library for game development, offering a widerange of features to simplify your coding journey. Let's delve intowhat pygame has to offer:

Graphics - With pygame, creating dynamic and engaging graphics hasnever been easier. The library provides simple yet effective tools for2D graphics and animation, including support for images, rectangles,and polygon shapes. Whether you're a seasoned game developer or juststarting out, pygame has you covered.

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

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

Game Development - Lastly, pygame provides a comprehensive suite of toolsand features specifically designed for game development. From collisiondetection to sprite management, pygame has everything you need to createexciting and engaging games. Whether you're building a platformer, puzzlegame, 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 pygamelocally from its source code, rather than pip installing it.

Installing from source is fairly automated. The most work willinvolve compiling and installing all the pygame dependencies. Oncethat is done, run thesetup.py script which will attempt toauto-configure, build, and install pygame.

Much more information about installing and compiling is availableon theCompilation 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, GordonTyler, 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, MatthiasSpiller, Bo Jangeborg, Dmitry Borisov, Campbell Barton, Diego Essaya,Eyal Lotem, Regis Desgroppes, Emmanuel Hainry, Randy KaelberMatthew 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, FrankRaiser, Austin Henry, Kaweh Kazemi, Arturo Aldama, Mike Mulcheck,Michael Benfield, David Lau

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

Many thank you's for people making documentation comments, and adding to thepygame.org wiki.

Also many thanks for people creating games and putting them on thepygame.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 ourexcellent hosting.

Dependencies

Pygame is obviously strongly dependent on SDL and Python. It alsolinks to and embeds several other smaller libraries. The fontmodule relies on SDL_ttf, which is dependent on freetype. The mixer(and mixer.music) modules depend on SDL_mixer. The image moduledepends on SDL_image, which also can use libjpeg and libpng. Thetransform module has an embedded version of SDL_rotozoom for itsown rotozoom function. The surfarray module requires the PythonNumPy 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 underGNU LGPL version 2.1, which canbe found in the filedocs/LGPL.txt. We reserve the right to placefuture 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, thosemust be released with a compatible license (preferably submittedback to the pygame project). Closed source and commercial games are fine.

The programs in theexamples subdirectory are in the public domain.

See docs/licenses for licenses of dependencies.

About

🐍🎮 pygame (the library) is a Free and Open Source python programming language library for making multimedia applications like games built on top of the excellent SDL library. C, Python, Native, OpenGL.

Topics

Resources

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp