diff --git a/p/Pygame.py b/p/Pygame.py new file mode 100644 index 00000000..44706ff1 --- /dev/null +++ b/p/Pygame.py @@ -0,0 +1,18 @@ +import pygame, sys +from pygame.locals import QUIT + +pygame.init() +display_surface = pygame.display.set_mode((400, 300)) +font = pygame.font.Font(pygame.font.get_default_font(), 32) +text = font.render('Hello World', True, (0, 0, 0)) +textRect = text.get_rect() + +while True: + display_surface.fill((255, 255, 255)) + display_surface.blit(text, textRect) + for event in pygame.event.get(): + if event.type == QUIT: + pygame.quit() + sys.exit() + + pygame.display.update() diff --git a/readme.md b/readme.md index e648f8ff..076dc537 100644 --- a/readme.md +++ b/readme.md @@ -669,6 +669,7 @@ Make sure to see [contributing.md](/contributing.md) for instructions on contrib * [Pure Data](p/Pure%20Data.pd) * [PureBasic](p/PureBasic.pb) * [PureScript](p/PureScript.purs) +* [Pygame](p/Pygame.py) * [PyQt4](p/PyQt4.py) * [PyQt5](p/PyQt5.py) * [Pyret](p/Pyret.arr)