Add Pygame (#1247)
* Create Pygame.py * Update readme.md * Update Pygame.py Co-authored-by: MrBrain295 <66077254+MrBrain295@users.noreply.github.com>
This commit is contained in:
18
p/Pygame.py
Normal file
18
p/Pygame.py
Normal file
@@ -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()
|
||||||
@@ -669,6 +669,7 @@ Make sure to see [contributing.md](/contributing.md) for instructions on contrib
|
|||||||
* [Pure Data](p/Pure%20Data.pd)
|
* [Pure Data](p/Pure%20Data.pd)
|
||||||
* [PureBasic](p/PureBasic.pb)
|
* [PureBasic](p/PureBasic.pb)
|
||||||
* [PureScript](p/PureScript.purs)
|
* [PureScript](p/PureScript.purs)
|
||||||
|
* [Pygame](p/Pygame.py)
|
||||||
* [PyQt4](p/PyQt4.py)
|
* [PyQt4](p/PyQt4.py)
|
||||||
* [PyQt5](p/PyQt5.py)
|
* [PyQt5](p/PyQt5.py)
|
||||||
* [Pyret](p/Pyret.arr)
|
* [Pyret](p/Pyret.arr)
|
||||||
|
|||||||
Reference in New Issue
Block a user