Pygame
≈ 2 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
Pygame is a cross-platform library of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language.
Pygame is a cross-platform library of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language. ==History== Pygame was originally written by Pete Shinners to replace PySDL after its development stalled. It has been a community project since 2000 and is released under the free software GNU Lesser General Public License (which "provides for Pygame to be distributed with open source and commercial software" ). ==Development of version 2== Pygame version 2 was planned as "Pygame Reloaded" in 2009, but development and maintenance of Pygame completely stopped until the end of 2016 with version 1.9.1. After the release of version 1.9.5 in March 2019, development of a new version 2 was active on the roadmap. Pygame 2.0 released on 28 October 2020, Pygame's 20th anniversary. ==Features== ==Community== There is a regular competition, called PyWeek, to write games using Python (and usually but not necessarily, Pygame). The community has created many tutorials for Pygame. Pygame also has a community-led subreddit on Reddit, where developers post their creations and ideas, and a Discord community server, where people discuss various aspects of the platform. ==Sample code== The following code makes an image of a raccoon ("raccoon.png") bounce when hitting an edge. import pygame, sys pygame.init() screen = pygame.display.set_mode((1280, 720)) clock = pygame.time.Clock() clock.tick(30) black = 0, 0, 0 raccoon = pygame.image.load("raccoon.png") raccoon = pygame.transform.scale(raccoon, (200, 140)) raccoonrect = raccoon.get_rect() velocity = [1, 1] while True: raccoonrect = raccoonrect.move(velocity) if raccoonrect.left 1280: velocity[0] = -velocity[0] raccoon = pygame.transform.flip(raccoon, True, False) if raccoonrect.top 720: velocity[1] = -velocity[1] for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() # screen update screen.fill(black) screen.blit(raccoon, raccoonrect) pygame.display.flip() ==Notable games using Pygame== Frets on Fire Dangerous High School Girls in Trouble! ==See also== Cocos2d Panda3D Pyglet Ren'Py ==Notes== ==References== ==External links== [news://gmane.comp.python.pygame Pygame newsgroup] (web access) - the "official" Pygame Subset for Android (PGS4A) pyOpenGL - Python OpenGL Bindings Pygame-SDL2 - a reimplementation of Pygame APIs on top of SDL2 PySDL2 - a wrapper around the SDL2 library similar to the discontinued PySDL project
Text derived from https://en.wikipedia.org/w/index.php?oldid=1371193726 under CC BY-SA 4.0; modifications have been made.
References
1 claim could not be tied to a specific sentence and is listed in the table below instead.