Created
October 18, 2018 23:48
-
-
Save topherPedersen/7ebb938fa583d11f6ed623ce3e6b6faf to your computer and use it in GitHub Desktop.
pygame "hello, world" example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://nerdparadise.com/programming/pygame/part1 | |
| import pygame | |
| pygame.init() | |
| screen = pygame.display.set_mode((400, 300)) | |
| # Add this somewhere after the event pumping and before the display.flip() | |
| pygame.draw.rect(screen, (0, 128, 255), pygame.Rect(30, 30, 60, 60)) | |
| done = False | |
| while not done: | |
| for event in pygame.event.get(): | |
| if event.type == pygame.QUIT: | |
| done = True | |
| pygame.display.flip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment