Last active
March 13, 2017 00:23
-
-
Save cowdinosaur/b3f84aafba560acd0c04 to your computer and use it in GitHub Desktop.
Pygame barebones template
This file contains 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
import pygame, sys | |
from pygame.locals import * | |
pygame.init() | |
DISPLAYSURF = pygame.display.set_mode((400, 300)) | |
pygame.display.set_caption('Hello World!') | |
while True: # main game loop | |
for event in pygame.event.get(): | |
if event.type == QUIT: | |
pygame.quit() | |
sys.exit() | |
pygame.display.update() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, you could replace
pygame.display.update()
with
pygame.display.flip()
unless you don't plan to update the whole screen.
http://stackoverflow.com/questions/29314987/difference-between-pygame-display-update-and-pygame-display-flip