encyclopegia.org

Pygame

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

References

No reference rows published for this article.

Cite this article

MLA

"Pygame." encyclopegia.org, 2026, https://encyclopegia.org/wiki/pygame. Accessed 24 November 2026.

Chicago

"Pygame." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/pygame.

APA

encyclopegia.org. (2026). Pygame. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/pygame

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
release date2020-10-28Wikipedia
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1371193726 · 0.5 · snapshot enwiki-001371193726

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.